From b90d17cbc02093c6c59753a26262fa39a5ef9e52 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 1 Dec 2022 18:13:47 +0000 Subject: [PATCH 1/2] feat: added LoadSnapshot, SaveSnapshot RPCs feat: added fields maintenance_window, workloads_config, environment_size, master_authorized_networks_config, recovery_config to EnvironmentConfig feat: added field scheduler_count to SoftwareConfig feat: added field enable_ip_masq_agent to NodeConfig feat: added fields cloud_composer_network_ipv4_cidr_block, cloud_composer_network_ipv4_reserved_range, enable_privately_used_public_ips, cloud_composer_connection_subnetwork, networking_config to PrivateEnvironmentConfig PiperOrigin-RevId: 492193414 Source-Link: https://github.com/googleapis/googleapis/commit/34eb8f1662a226c9cc6640066111ca2d3014f30d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ac6572620255fbf06316b68019eec52b32c4cc8a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9yY2hlc3RyYXRpb24tYWlyZmxvdy1zZXJ2aWNlLy5Pd2xCb3QueWFtbCIsImgiOiJhYzY1NzI2MjAyNTVmYmYwNjMxNmI2ODAxOWVlYzUyYjMyYzRjYzhhIn0= --- .../v1/.eslintignore | 7 + .../v1/.eslintrc.json | 3 + .../v1/.gitignore | 14 + .../v1/.jsdoc.js | 55 + .../v1/.mocharc.js | 33 + .../v1/.prettierrc.js | 22 + .../v1/README.md | 1 + .../v1/linkinator.config.json | 16 + .../v1/package.json | 65 + .../airflow/service/v1/environments.proto | 1129 ++++++++++ .../airflow/service/v1/image_versions.proto | 88 + .../airflow/service/v1/operations.proto | 93 + .../v1/environments.create_environment.js | 66 + .../v1/environments.delete_environment.js | 62 + .../v1/environments.get_environment.js | 61 + .../v1/environments.list_environments.js | 71 + .../v1/environments.load_snapshot.js | 87 + .../v1/environments.save_snapshot.js | 67 + .../v1/environments.update_environment.js | 184 ++ .../v1/image_versions.list_image_versions.js | 75 + ...loud.orchestration.airflow.service.v1.json | 391 ++++ .../v1/src/index.ts | 27 + .../v1/src/v1/environments_client.ts | 1473 +++++++++++++ .../v1/src/v1/environments_client_config.json | 54 + .../v1/src/v1/environments_proto_list.json | 5 + .../v1/src/v1/gapic_metadata.json | 125 ++ .../v1/src/v1/image_versions_client.ts | 557 +++++ .../src/v1/image_versions_client_config.json | 30 + .../v1/src/v1/image_versions_proto_list.json | 5 + .../v1/src/v1/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 38 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_environments_v1.ts | 1640 ++++++++++++++ .../v1/test/gapic_image_versions_v1.ts | 491 +++++ .../v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + .../v1beta1/.eslintignore | 7 + .../v1beta1/.eslintrc.json | 3 + .../v1beta1/.gitignore | 14 + .../v1beta1/.jsdoc.js | 55 + .../v1beta1/.mocharc.js | 33 + .../v1beta1/.prettierrc.js | 22 + .../v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + .../v1beta1/package.json | 65 + .../service/v1beta1/environments.proto | 1305 +++++++++++ .../service/v1beta1/image_versions.proto | 88 + .../airflow/service/v1beta1/operations.proto | 89 + .../v1beta1/environments.check_upgrade.js | 86 + .../environments.create_environment.js | 66 + .../environments.delete_environment.js | 62 + .../v1beta1/environments.get_environment.js | 61 + .../v1beta1/environments.list_environments.js | 71 + .../v1beta1/environments.load_snapshot.js | 87 + .../environments.restart_web_server.js | 63 + .../v1beta1/environments.save_snapshot.js | 67 + .../environments.update_environment.js | 206 ++ .../image_versions.list_image_versions.js | 75 + ...orchestration.airflow.service.v1beta1.json | 475 ++++ .../v1beta1/src/index.ts | 27 + .../src/v1beta1/environments_client.ts | 1723 +++++++++++++++ .../v1beta1/environments_client_config.json | 62 + .../src/v1beta1/environments_proto_list.json | 5 + .../v1beta1/src/v1beta1/gapic_metadata.json | 145 ++ .../src/v1beta1/image_versions_client.ts | 557 +++++ .../v1beta1/image_versions_client_config.json | 30 + .../v1beta1/image_versions_proto_list.json | 5 + .../v1beta1/src/v1beta1/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 38 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_environments_v1beta1.ts | 1948 +++++++++++++++++ .../test/gapic_image_versions_v1beta1.ts | 491 +++++ .../v1beta1/tsconfig.json | 19 + .../v1beta1/webpack.config.js | 64 + 76 files changed, 15443 insertions(+) create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js new file mode 100644 index 00000000000..4eacd7d3697 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// 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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/orchestration-airflow', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js new file mode 100644 index 00000000000..481c522b00f --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// 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. ** + +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 diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js new file mode 100644 index 00000000000..494e147865d --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md new file mode 100644 index 00000000000..536af38a9bb --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md @@ -0,0 +1 @@ +Service: Nodejs Client diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json new file mode 100644 index 00000000000..05f03ef3726 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json @@ -0,0 +1,65 @@ +{ + "name": "@google-cloud/orchestration-airflow", + "version": "0.1.0", + "description": "Service client for Node.js", + "repository": "googleapis/nodejs-service", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google service", + "service", + "environments", + "image versions" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.62", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto new file mode 100644 index 00000000000..0916ec9597d --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto @@ -0,0 +1,1129 @@ +// 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 +// +// 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.orchestration.airflow.service.v1; + +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/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; +option java_multiple_files = true; +option java_package = "com.google.cloud.orchestration.airflow.service.v1"; + +// Managed Apache Airflow Environments. +service Environments { + option (google.api.default_host) = "composer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new environment. + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Get an existing environment. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List environments. + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Update an environment. + rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "name,environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Delete an environment. + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Creates a snapshots of a Cloud Composer environment. + // + // As a result of this operation, snapshot of environment's state is stored + // in a location specified in the SaveSnapshotRequest. + rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Loads a snapshot of a Cloud Composer environment. + // + // As a result of this operation, a snapshot of environment's specified in + // LoadSnapshotRequest is loaded into the environment. + rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } +} + +// Create a new environment. +message CreateEnvironmentRequest { + // The parent must be of the form + // "projects/{projectId}/locations/{locationId}". + string parent = 1; + + // The environment to create. + Environment environment = 2; +} + +// Get an environment. +message GetEnvironmentRequest { + // The resource name of the environment to get, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 1; +} + +// List environments in a project and location. +message ListEnvironmentsRequest { + // List environments in the given project and location, in the form: + // "projects/{projectId}/locations/{locationId}" + string parent = 1; + + // The maximum number of environments to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The environments in a project and location. +message ListEnvironmentsResponse { + // The list of environments returned by a ListEnvironmentsRequest. + repeated Environment environments = 1; + + // The page token used to query for the next page if one exists. + string next_page_token = 2; +} + +// Delete an environment. +message DeleteEnvironmentRequest { + // The environment to delete, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 1; +} + +// Update an environment. +message UpdateEnvironmentRequest { + // The relative resource name of the environment to update, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 2; + + // A patch environment. Fields specified by the `updateMask` will be copied + // from the patch environment into the environment under update. + Environment environment = 1; + + // Required. A comma-separated list of paths, relative to `Environment`, of + // fields to update. + // For example, to set the version of scikit-learn to install in the + // environment to 0.19.0 and to remove an existing installation of + // numpy, the `updateMask` parameter would include the following two + // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + // "config.softwareConfig.pypiPackages.numpy". The included patch + // environment would specify the scikit-learn version as follows: + // + // { + // "config":{ + // "softwareConfig":{ + // "pypiPackages":{ + // "scikit-learn":"==0.19.0" + // } + // } + // } + // } + // + // Note that in the above example, any existing PyPI packages + // other than scikit-learn and numpy will be unaffected. + // + // Only one update type may be included in a single request's `updateMask`. + // For example, one cannot update both the PyPI packages and + // labels in the same request. However, it is possible to update multiple + // members of a map field simultaneously in the same request. For example, + // to set the labels "label1" and "label2" while clearing "label3" (assuming + // it already exists), one can + // provide the paths "labels.label1", "labels.label2", and "labels.label3" + // and populate the patch environment as follows: + // + // { + // "labels":{ + // "label1":"new-label1-value" + // "label2":"new-label2-value" + // } + // } + // + // Note that in the above example, any existing labels that are not + // included in the `updateMask` will be unaffected. + // + // It is also possible to replace an entire map field by providing the + // map field's path in the `updateMask`. The new value of the field will + // be that which is provided in the patch environment. For example, to + // delete all pre-existing user-specified PyPI packages and + // install botocore at version 1.7.14, the `updateMask` would contain + // the path "config.softwareConfig.pypiPackages", and + // the patch environment would be the following: + // + // { + // "config":{ + // "softwareConfig":{ + // "pypiPackages":{ + // "botocore":"==1.7.14" + // } + // } + // } + // } + // + // **Note:** Only the following fields can be updated: + // + // * `config.softwareConfig.pypiPackages` + // * Replace all custom custom PyPI packages. If a replacement + // package map is not included in `environment`, all custom + // PyPI packages are cleared. It is an error to provide both + // this mask and a mask specifying an individual package. + // * `config.softwareConfig.pypiPackages.`packagename + // * Update the custom PyPI package *packagename*, + // preserving other packages. To delete the package, include it in + // `updateMask`, and omit the mapping for it in + // `environment.config.softwareConfig.pypiPackages`. It is an error + // to provide both a mask of this form and the + // `config.softwareConfig.pypiPackages` mask. + // * `labels` + // * Replace all environment labels. If a replacement labels map is not + // included in `environment`, all labels are cleared. It is an error to + // provide both this mask and a mask specifying one or more individual + // labels. + // * `labels.`labelName + // * Set the label named *labelName*, while preserving other + // labels. To delete the label, include it in `updateMask` and omit its + // mapping in `environment.labels`. It is an error to provide both a + // mask of this form and the `labels` mask. + // * `config.nodeCount` + // * Horizontally scale the number of nodes in the environment. An integer + // greater than or equal to 3 must be provided in the `config.nodeCount` + // field. Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + // * `config.webServerNetworkAccessControl` + // * Replace the environment's current `WebServerNetworkAccessControl`. + // * `config.softwareConfig.airflowConfigOverrides` + // * Replace all Apache Airflow config overrides. If a replacement config + // overrides map is not included in `environment`, all config overrides + // are cleared. + // It is an error to provide both this mask and a mask specifying one or + // more individual config overrides. + // * `config.softwareConfig.airflowConfigOverrides.`section-name + // * Override the Apache Airflow config property *name* in the + // section named *section*, preserving other properties. To + // delete the property override, include it in `updateMask` and omit its + // mapping in + // `environment.config.softwareConfig.airflowConfigOverrides`. + // It is an error to provide both a mask of this form and the + // `config.softwareConfig.airflowConfigOverrides` mask. + // * `config.softwareConfig.envVariables` + // * Replace all environment variables. If a replacement environment + // variable map is not included in `environment`, all custom environment + // variables are cleared. + // * `config.softwareConfig.schedulerCount` + // * Horizontally scale the number of schedulers in Airflow. A positive + // integer not greater than the number of nodes must be provided in the + // `config.softwareConfig.schedulerCount` field. Supported for Cloud + // Composer environments in versions composer-1.*.*-airflow-2.*.*. + // * `config.databaseConfig.machineType` + // * Cloud SQL machine type used by Airflow database. + // It has to be one of: db-n1-standard-2, db-n1-standard-4, + // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + // environments in versions composer-1.*.*-airflow-*.*.*. + // * `config.webServerConfig.machineType` + // * Machine type on which Airflow web server is running. + // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + // or composer-n1-webserver-8. Supported for Cloud Composer environments + // in versions composer-1.*.*-airflow-*.*.*. + google.protobuf.FieldMask update_mask = 3; +} + +// Request to create a snapshot of a Cloud Composer environment. +message SaveSnapshotRequest { + // The resource name of the source environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + // "gs://my-bucket/snapshots". + string snapshot_location = 2; +} + +// Response to SaveSnapshotRequest. +message SaveSnapshotResponse { + // The fully-resolved Cloud Storage path of the created snapshot, + // e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + // This field is populated only if the snapshot creation was successful. + string snapshot_path = 1; +} + +// Request to load a snapshot into a Cloud Composer environment. +message LoadSnapshotRequest { + // The resource name of the target environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // A Cloud Storage path to a snapshot to load, e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + string snapshot_path = 2; + + // Whether or not to skip installing Pypi packages when loading the + // environment's state. + bool skip_pypi_packages_installation = 3; + + // Whether or not to skip setting environment variables when loading the + // environment's state. + bool skip_environment_variables_setting = 4; + + // Whether or not to skip setting Airflow overrides when loading the + // environment's state. + bool skip_airflow_overrides_setting = 5; + + // Whether or not to skip copying Cloud Storage data when loading the + // environment's state. + bool skip_gcs_data_copying = 6; +} + +// Response to LoadSnapshotRequest. +message LoadSnapshotResponse { + +} + +// Configuration information for an environment. +message EnvironmentConfig { + // The size of the Cloud Composer environment. + enum EnvironmentSize { + // The size of the environment is unspecified. + ENVIRONMENT_SIZE_UNSPECIFIED = 0; + + // The environment size is small. + ENVIRONMENT_SIZE_SMALL = 1; + + // The environment size is medium. + ENVIRONMENT_SIZE_MEDIUM = 2; + + // The environment size is large. + ENVIRONMENT_SIZE_LARGE = 3; + } + + // Output only. The Kubernetes Engine cluster used to run this environment. + string gke_cluster = 1; + + // Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud + // Storage objects reside in a flat namespace, a hierarchical file tree + // can be simulated using "/"-delimited object name prefixes. DAG objects for + // this environment reside in a simulated directory with the given prefix. + string dag_gcs_prefix = 2; + + // The number of nodes in the Kubernetes Engine cluster that will be + // used to run this environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + int32 node_count = 3; + + // The configuration settings for software inside the environment. + SoftwareConfig software_config = 4; + + // The configuration used for the Kubernetes Engine cluster. + NodeConfig node_config = 5; + + // The configuration used for the Private IP Cloud Composer environment. + PrivateEnvironmentConfig private_environment_config = 7; + + // Optional. The network-level access control policy for the Airflow web server. If + // unspecified, no network-level access restrictions will be applied. + WebServerNetworkAccessControl web_server_network_access_control = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration settings for Cloud SQL instance used internally by Apache + // Airflow software. + DatabaseConfig database_config = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration settings for the Airflow web server App Engine instance. + WebServerConfig web_server_config = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption options for the Cloud Composer environment + // and its dependencies. Cannot be updated. + EncryptionConfig encryption_config = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance window is the period when Cloud Composer components may + // undergo maintenance. It is defined so that maintenance is not executed + // during peak hours or critical time periods. + // + // The system will not be under maintenance for every occurrence of this + // window, but when maintenance is planned, it will be scheduled + // during the window. + // + // The maintenance window period must encompass at least 12 hours per week. + // This may be split into multiple chunks, each with a size of + // at least 4 hours. + // + // If this value is omitted, the default value for maintenance window will be + // applied. The default value is Saturday and Sunday 00-06 GMT. + MaintenanceWindow maintenance_window = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The workloads configuration settings for the GKE cluster associated with + // the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web + // server and workers workloads. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + WorkloadsConfig workloads_config = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the Cloud Composer environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see + // [Airflow web + // interface](/composer/docs/how-to/accessing/airflow-web-interface)). + string airflow_uri = 6; + + // Optional. The configuration options for GKE cluster master authorized networks. + // By default master authorized networks feature is: + // - in case of private environment: enabled with no external networks + // allowlisted. + // - in case of public environment: disabled. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Recovery settings configuration of an environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// Network-level access control policy for the Airflow web server. +message WebServerNetworkAccessControl { + // Allowed IP range with user-provided description. + message AllowedIpRange { + // IP address or range, defined using CIDR notation, of requests that this + // rule applies to. + // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` + // or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. + // + // IP range prefixes should be properly truncated. For example, + // `1.2.3.4/24` should be truncated to `1.2.3.0/24`. Similarly, for IPv6, + // `2001:db8::1/32` should be truncated to `2001:db8::/32`. + string value = 1; + + // Optional. User-provided description. It must contain at most 300 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // A collection of allowed IP ranges with descriptions. + repeated AllowedIpRange allowed_ip_ranges = 1; +} + +// The configuration of Cloud SQL instance that is used by the Apache Airflow +// software. +message DatabaseConfig { + // Optional. Cloud SQL machine type used by Airflow database. + // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 + // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. + // Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration settings for the Airflow web server App Engine instance. +// Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.* +message WebServerConfig { + // Optional. Machine type on which Airflow web server is running. + // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or + // composer-n1-webserver-8. + // If not specified, composer-n1-webserver-2 will be used. + // Value custom is returned only in response, if Airflow web server parameters + // were manually changed to a non-standard values. + string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The encryption options for the Cloud Composer environment +// and its dependencies.Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. +message EncryptionConfig { + // Optional. Customer-managed Encryption Key available through Google's Key Management + // Service. Cannot be updated. + // If not specified, Google-managed key will be used. + string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration settings for Cloud Composer maintenance window. +// The following example: +// +// ``` +// { +// "startTime":"2019-08-01T01:00:00Z" +// "endTime":"2019-08-01T07:00:00Z" +// "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE" +// } +// ``` +// +// would define a maintenance window between 01 and 07 hours UTC during +// each Tuesday and Wednesday. +message MaintenanceWindow { + // Required. Start time of the first recurrence of the maintenance window. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window end time. It is used only to calculate the duration of + // the maintenance window. + // The value for end-time must be in the future, relative to + // `start_time`. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window recurrence. Format is a subset of + // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed + // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...` + // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`. + string recurrence = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the selection and configuration of software inside the environment. +message SoftwareConfig { + // The version of the software running in the environment. + // This encapsulates both the version of Cloud Composer functionality and the + // version of Apache Airflow. It must match the regular expression + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. + // When used as input, the server also checks if the provided version is + // supported and denies the request for an unsupported version. + // + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. + // + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. + // + // In all cases, the resolved image version is stored in the same field. + // + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). + string image_version = 1; + + // Optional. Apache Airflow configuration properties to override. + // + // Property keys contain the section and property names, separated by a + // hyphen, for example "core-dags_are_paused_at_creation". Section names must + // not contain hyphens ("-"), opening square brackets ("["), or closing + // square brackets ("]"). The property name must not be empty and must not + // contain an equals sign ("=") or semicolon (";"). Section and property names + // must not contain a period ("."). Apache Airflow configuration property + // names must be written in + // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property values can + // contain any character, and can be written in any lower/upper case format. + // + // Certain Apache Airflow configuration property values are + // [blocked](/composer/docs/concepts/airflow-configurations), + // and cannot be overridden. + map airflow_config_overrides = 2; + + // Optional. Custom Python Package Index (PyPI) packages to be installed in + // the environment. + // + // Keys refer to the lowercase package name such as "numpy" + // and values are the lowercase extras and version specifier such as + // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To specify a + // package without pinning it to a version specifier, use the empty string as + // the value. + map pypi_packages = 3; + + // Optional. Additional environment variables to provide to the Apache Airflow + // scheduler, worker, and webserver processes. + // + // Environment variable names must match the regular expression + // `[a-zA-Z_][a-zA-Z0-9_]*`. They cannot specify Apache Airflow + // software configuration overrides (they cannot match the regular expression + // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of the + // following reserved names: + // + // * `AIRFLOW_HOME` + // * `C_FORCE_ROOT` + // * `CONTAINER_NAME` + // * `DAGS_FOLDER` + // * `GCP_PROJECT` + // * `GCS_BUCKET` + // * `GKE_CLUSTER_NAME` + // * `SQL_DATABASE` + // * `SQL_INSTANCE` + // * `SQL_PASSWORD` + // * `SQL_PROJECT` + // * `SQL_REGION` + // * `SQL_USER` + map env_variables = 4; + + // Optional. The major version of Python used to run the Apache Airflow + // scheduler, worker, and webserver processes. + // + // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be + // updated. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // Python major version 3. + string python_version = 6; + + // Optional. The number of schedulers for Airflow. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-2.*.*. + int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for controlling how IPs are allocated in the +// GKE cluster running the Apache Airflow software. +message IPAllocationPolicy { + // Optional. Whether or not to enable Alias IPs in the GKE cluster. + // If `true`, a VPC-native cluster is created. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // VPC-native GKE clusters. + bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Configuration of allocating IP addresses for pods in the GKE cluster. + oneof cluster_ip_allocation { + // Optional. The name of the GKE cluster's secondary range used to allocate + // IP addresses to pods. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address range used to allocate IP addresses to pods in + // the GKE cluster. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + // + // Set to blank to have GKE choose a range with the default size. + // + // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + // netmask. + // + // Set to a + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + string cluster_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration of allocating IP addresses for services in the GKE cluster. + oneof services_ip_allocation { + // Optional. The name of the services' secondary range used to allocate + // IP addresses to the GKE cluster. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address range of the services IP addresses in this + // GKE cluster. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + // + // Set to blank to have GKE choose a range with the default size. + // + // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + // netmask. + // + // Set to a + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + string services_ipv4_cidr_block = 5 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// The configuration information for the Kubernetes Engine nodes running +// the Apache Airflow software. +message NodeConfig { + // Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which + // to deploy the VMs used to run the Apache Airflow software, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/zones/{zoneId}". + // + // This `location` must belong to the enclosing environment's project and + // location. If both this field and `nodeConfig.machineType` are specified, + // `nodeConfig.machineType` must belong to this `location`; if both are + // unspecified, the service will pick a zone in the Compute Engine region + // corresponding to the Cloud Composer location, and propagate that choice to + // both fields. If only one field (`location` or `nodeConfig.machineType`) is + // specified, the location information from the specified field will be + // propagated to the unspecified field. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string location = 1; + + // Optional. The Compute Engine + // [machine type](/compute/docs/machine-types) used for cluster instances, + // specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTypeId}". + // + // The `machineType` must belong to the enclosing environment's project and + // location. If both this field and `nodeConfig.location` are specified, + // this `machineType` must belong to the `nodeConfig.location`; if both are + // unspecified, the service will pick a zone in the Compute Engine region + // corresponding to the Cloud Composer location, and propagate that choice to + // both fields. If exactly one of this field and `nodeConfig.location` is + // specified, the location information from the specified field will be + // propagated to the unspecified field. + // + // The `machineTypeId` must not be a [shared-core machine + // type](/compute/docs/machine-types#sharedcore). + // + // If this field is unspecified, the `machineTypeId` defaults + // to "n1-standard-1". + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string machine_type = 2; + + // Optional. The Compute Engine network to be used for machine + // communications, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/global/networks/{networkId}". + // + // If unspecified, the "default" network ID in the environment's project is + // used. If a [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets) + // is provided, `nodeConfig.subnetwork` must also be provided. For + // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements, see + // `nodeConfig.subnetwork`. + string network = 3; + + // Optional. The Compute Engine subnetwork to be used for machine + // communications, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" + // + // If a subnetwork is provided, `nodeConfig.network` must also be provided, + // and the subnetwork must belong to the enclosing environment's project and + // location. + string subnetwork = 4; + + // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. + // If unspecified, defaults to 100GB. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + int32 disk_size_gb = 5; + + // Optional. The set of Google API scopes to be made available on all + // node VMs. If `oauth_scopes` is empty, defaults to + // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + repeated string oauth_scopes = 6; + + // Optional. The Google Cloud Platform Service Account to be used by the node + // VMs. If a service account is not specified, the "default" Compute Engine + // service account is used. Cannot be updated. + string service_account = 7; + + // Optional. The list of instance tags applied to all node VMs. Tags are used + // to identify valid sources or targets for network firewalls. Each tag within + // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + repeated string tags = 8; + + // Optional. The configuration for controlling how IPs are allocated in the GKE cluster. + IPAllocationPolicy ip_allocation_policy = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines + // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for + // all destination addresses, except between pods traffic. + // + // See: + // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent + bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the private GKE cluster in a Cloud Composer +// environment. +message PrivateClusterConfig { + // Optional. If `true`, access to the public endpoint of the GKE cluster is + // denied. + bool enable_private_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IPv4 range for GKE master will be reserved. If + // left blank, the default value of '172.16.0.0/23' is used. + string master_ipv4_cidr_block = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range in CIDR notation to use for the hosted master network. This + // range is used for assigning internal IP addresses to the GKE cluster + // master or set of masters and to the internal load balancer virtual IP. + // This range must not overlap with any other ranges in use + // within the cluster's network. + string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration options for networking connections in the Composer 2 +// environment. +message NetworkingConfig { + // Represents connection type between Composer environment in Customer + // Project and the corresponding Tenant project, from a predefined list + // of available connection modes. + enum ConnectionType { + // No specific connection type was requested, so the environment uses + // the default value corresponding to the rest of its configuration. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Requests the use of VPC peerings for connecting the Customer and Tenant + // projects. + VPC_PEERING = 1; + + // Requests the use of Private Service Connect for connecting the Customer + // and Tenant projects. + PRIVATE_SERVICE_CONNECT = 2; + } + + // Optional. Indicates the user requested specifc connection type between Tenant and + // Customer projects. + // You cannot set networking connection type in public IP environment. + ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration information for configuring a Private IP Cloud Composer +// environment. +message PrivateEnvironmentConfig { + // Optional. If `true`, a Private IP Cloud Composer environment is created. + // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be + // set to true for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the private GKE cluster for a Private IP + // Cloud Composer environment. + PrivateClusterConfig private_cluster_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IP range for web server will be reserved. Needs + // to be disjoint from `private_cluster_config.master_ipv4_cidr_block` and + // `cloud_sql_ipv4_cidr_block`. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IP range in tenant project will be reserved for + // Cloud SQL. Needs to be disjoint from `web_server_ipv4_cidr_block`. + string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range reserved for the tenant project's App Engine VMs. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant + // project will be reserved. Needs to be disjoint from + // private_cluster_config.master_ipv4_cidr_block and + // cloud_sql_ipv4_cidr_block. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_cidr_block = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range reserved for the tenant project's Cloud Composer network. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for + // `IPAllocationPolicy.cluster_ipv4_cidr_block` and + // `IPAllocationPolicy.service_ipv4_cidr_block`. + bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specified, the environment will use Private Service Connect + // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, + // and the PSC endpoint in the Customer Project will use an IP address from + // this subnetwork. + string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the network connections configuration in the environment. + NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Kubernetes workloads configuration for GKE cluster associated with the +// Cloud Composer environment. Supported for Cloud Composer environments in +// versions composer-2.*.*-airflow-*.*.* and newer. +message WorkloadsConfig { + // Configuration for resources used by Airflow schedulers. + message SchedulerResource { + // Optional. CPU request and limit for a single Airflow scheduler replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow scheduler replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow scheduler replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of schedulers. + int32 count = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow web server. + message WebServerResource { + // Optional. CPU request and limit for Airflow web server. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for Airflow web server. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for Airflow web server. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow workers. + message WorkerResource { + // Optional. CPU request and limit for a single Airflow worker replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow worker replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow worker replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of workers for autoscaling. + int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of workers for autoscaling. + int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Resources used by Airflow schedulers. + SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow web server. + WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow workers. + WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Recovery settings of an environment. +message RecoveryConfig { + // Optional. The configuration for scheduled snapshot creation mechanism. + ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration for scheduled snapshot creation mechanism. +message ScheduledSnapshotsConfig { + // Optional. Whether scheduled snapshots creation is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage location for storing automatically created snapshots. + string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cron expression representing the time when snapshots creation mechanism + // runs. This field is subject to additional validation around frequency of + // execution. + string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +message MasterAuthorizedNetworksConfig { + // CIDR block with an optional name. + message CidrBlock { + // User-defined name that identifies the CIDR block. + string display_name = 1; + + // CIDR block that must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks feature is enabled. + bool enabled = 1; + + // Up to 50 external networks that could access Kubernetes master through + // HTTPS. + repeated CidrBlock cidr_blocks = 2; +} + +// An environment for running orchestration tasks. +message Environment { + option (google.api.resource) = { + type: "composer.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/environments/{environment}" + }; + + // State of the environment. + enum State { + // The state of the environment is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is in the process of being created. + CREATING = 1; + + // The environment is currently running and healthy. It is ready for use. + RUNNING = 2; + + // The environment is being updated. It remains usable but cannot receive + // additional update requests or be deleted at this time. + UPDATING = 3; + + // The environment is undergoing deletion. It cannot be used. + DELETING = 4; + + // The environment has encountered an error and cannot be used. + ERROR = 5; + } + + // The resource name of the environment, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + // + // EnvironmentId must start with a lowercase letter followed by up to 63 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string name = 1; + + // Configuration parameters for this environment. + EnvironmentConfig config = 2; + + // Output only. The UUID (Universally Unique IDentifier) associated with this environment. + // This value is generated when the environment is created. + string uuid = 3; + + // The current state of the environment. + State state = 4; + + // Output only. The time at which this environment was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. The time at which this environment was last modified. + google.protobuf.Timestamp update_time = 6; + + // Optional. User-defined labels for this environment. + // The labels map can contain no more than 64 entries. Entries of the labels + // map are UTF8 strings that comply with the following restrictions: + // + // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + // * Both keys and values are additionally constrained to be <= 128 bytes in + // size. + map labels = 7; +} + +// Message containing information about the result of an upgrade check +// operation. +message CheckUpgradeResponse { + // Whether there were python modules conflict during image build. + enum ConflictResult { + // It is unknown whether build had conflicts or not. + CONFLICT_RESULT_UNSPECIFIED = 0; + + // There were python packages conflicts. + CONFLICT = 1; + + // There were no python packages conflicts. + NO_CONFLICT = 2; + } + + // Output only. Url for a docker build log of an upgraded image. + string build_log_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether build has succeeded or failed on modules conflicts. + ConflictResult contains_pypi_modules_conflict = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extract from a docker image build log containing information about pypi + // modules conflicts. + string pypi_conflict_build_log_extract = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Composer image for which the build was happening. + string image_version = 5; + + // Pypi dependencies specified in the environment configuration, at the time + // when the build was triggered. + map pypi_dependencies = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto new file mode 100644 index 00000000000..8226c463b80 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto @@ -0,0 +1,88 @@ +// 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 +// +// 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.orchestration.airflow.service.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/type/date.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; +option java_multiple_files = true; +option java_package = "com.google.cloud.orchestration.airflow.service.v1"; + +// Readonly service to query available ImageVersions. +service ImageVersions { + option (google.api.default_host) = "composer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // List ImageVersions for provided location. + rpc ListImageVersions(ListImageVersionsRequest) returns (ListImageVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/imageVersions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// List ImageVersions in a project and location. +message ListImageVersionsRequest { + // List ImageVersions in the given project and location, in the form: + // "projects/{projectId}/locations/{locationId}" + string parent = 1; + + // The maximum number of image_versions to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // Whether or not image versions from old releases should be included. + bool include_past_releases = 4; +} + +// The ImageVersions in a project and location. +message ListImageVersionsResponse { + // The list of supported ImageVersions in a location. + repeated ImageVersion image_versions = 1; + + // The page token used to query for the next page if one exists. + string next_page_token = 2; +} + +// ImageVersion information +message ImageVersion { + // The string identifier of the ImageVersion, in the form: + // "composer-x.y.z-airflow-a.b.c" + string image_version_id = 1; + + // Whether this is the default ImageVersion used by Composer during + // environment creation if no input ImageVersion is specified. + bool is_default = 2; + + // supported python versions + repeated string supported_python_versions = 3; + + // The date of the version release. + google.type.Date release_date = 4; + + // Whether it is impossible to create an environment with the image version. + bool creation_disabled = 5; + + // Whether it is impossible to upgrade an environment running with the image + // version. + bool upgrade_disabled = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto new file mode 100644 index 00000000000..332e09623b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto @@ -0,0 +1,93 @@ +// 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 +// +// 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.orchestration.airflow.service.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; +option java_multiple_files = true; +option java_outer_classname = "OperationsProto"; +option java_package = "com.google.cloud.orchestration.airflow.service.v1"; + +// Metadata describing an operation. +message OperationMetadata { + // An enum describing the overall state of an operation. + enum State { + option allow_alias = true; + + // Unused. + STATE_UNSPECIFIED = 0; + + // The operation has been created but is not yet started. + PENDING = 1; + + // The operation is underway. + RUNNING = 2; + + // The operation completed successfully. + SUCCEEDED = 3; + + SUCCESSFUL = 3; + + // The operation is no longer running but did not succeed. + FAILED = 4; + } + + // Type of longrunning operation. + enum Type { + // Unused. + TYPE_UNSPECIFIED = 0; + + // A resource creation operation. + CREATE = 1; + + // A resource deletion operation. + DELETE = 2; + + // A resource update operation. + UPDATE = 3; + + // A resource check operation. + CHECK = 4; + + // Saves snapshot of the resource operation. + SAVE_SNAPSHOT = 5; + + // Loads snapshot of the resource operation. + LOAD_SNAPSHOT = 6; + } + + // Output only. The current operation state. + State state = 1; + + // Output only. The type of operation being performed. + Type operation_type = 2; + + // Output only. The resource being operated on, as a [relative resource name]( + // /apis/design/resource_names#relative_resource_name). + string resource = 3; + + // Output only. The UUID of the resource being operated on. + string resource_uuid = 4; + + // Output only. The time the operation was submitted to the server. + google.protobuf.Timestamp create_time = 5; + + // Output only. The time when the operation terminated, regardless of its success. + // This field is unset if the operation is still ongoing. + google.protobuf.Timestamp end_time = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js new file mode 100644 index 00000000000..facdb566575 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js @@ -0,0 +1,66 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_CreateEnvironment_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. + */ + /** + * The parent must be of the form + * "projects/{projectId}/locations/{locationId}". + */ + // const parent = 'abc123' + /** + * The environment to create. + */ + // const environment = {} + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callCreateEnvironment() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEnvironment(); + // [END composer_v1_generated_Environments_CreateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js new file mode 100644 index 00000000000..74dccacbe5e --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js @@ -0,0 +1,62 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_DeleteEnvironment_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. + */ + /** + * The environment to delete, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callDeleteEnvironment() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.deleteEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEnvironment(); + // [END composer_v1_generated_Environments_DeleteEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js new file mode 100644 index 00000000000..56aadc4191b --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js @@ -0,0 +1,61 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_GetEnvironment_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. + */ + /** + * The resource name of the environment to get, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callGetEnvironment() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.getEnvironment(request); + console.log(response); + } + + callGetEnvironment(); + // [END composer_v1_generated_Environments_GetEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js new file mode 100644 index 00000000000..0d6aaaca77d --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js @@ -0,0 +1,71 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_ListEnvironments_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. + */ + /** + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + */ + // const parent = 'abc123' + /** + * The maximum number of environments to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callListEnvironments() { + // Construct request + const request = { + }; + + // Run request + const iterable = await serviceClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEnvironments(); + // [END composer_v1_generated_Environments_ListEnvironments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js new file mode 100644 index 00000000000..7006d74d207 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js @@ -0,0 +1,87 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_LoadSnapshot_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. + */ + /** + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + */ + // const snapshotPath = 'abc123' + /** + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + */ + // const skipPypiPackagesInstallation = true + /** + * Whether or not to skip setting environment variables when loading the + * environment's state. + */ + // const skipEnvironmentVariablesSetting = true + /** + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + */ + // const skipAirflowOverridesSetting = true + /** + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + */ + // const skipGcsDataCopying = true + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callLoadSnapshot() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.loadSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLoadSnapshot(); + // [END composer_v1_generated_Environments_LoadSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js new file mode 100644 index 00000000000..96c8c1fb23e --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js @@ -0,0 +1,67 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_SaveSnapshot_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. + */ + /** + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + */ + // const snapshotLocation = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callSaveSnapshot() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.saveSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSaveSnapshot(); + // [END composer_v1_generated_Environments_SaveSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js new file mode 100644 index 00000000000..aaf10d52979 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js @@ -0,0 +1,184 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_Environments_UpdateEnvironment_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. + */ + /** + * The relative resource name of the environment to update, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + /** + * A patch environment. Fields specified by the `updateMask` will be copied + * from the patch environment into the environment under update. + */ + // const environment = {} + /** + * Required. A comma-separated list of paths, relative to `Environment`, of + * fields to update. + * For example, to set the version of scikit-learn to install in the + * environment to 0.19.0 and to remove an existing installation of + * numpy, the `updateMask` parameter would include the following two + * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * "config.softwareConfig.pypiPackages.numpy". The included patch + * environment would specify the scikit-learn version as follows: + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "scikit-learn":"==0.19.0" + * } + * } + * } + * } + * Note that in the above example, any existing PyPI packages + * other than scikit-learn and numpy will be unaffected. + * Only one update type may be included in a single request's `updateMask`. + * For example, one cannot update both the PyPI packages and + * labels in the same request. However, it is possible to update multiple + * members of a map field simultaneously in the same request. For example, + * to set the labels "label1" and "label2" while clearing "label3" (assuming + * it already exists), one can + * provide the paths "labels.label1", "labels.label2", and "labels.label3" + * and populate the patch environment as follows: + * { + * "labels":{ + * "label1":"new-label1-value" + * "label2":"new-label2-value" + * } + * } + * Note that in the above example, any existing labels that are not + * included in the `updateMask` will be unaffected. + * It is also possible to replace an entire map field by providing the + * map field's path in the `updateMask`. The new value of the field will + * be that which is provided in the patch environment. For example, to + * delete all pre-existing user-specified PyPI packages and + * install botocore at version 1.7.14, the `updateMask` would contain + * the path "config.softwareConfig.pypiPackages", and + * the patch environment would be the following: + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "botocore":"==1.7.14" + * } + * } + * } + * } + * **Note:** Only the following fields can be updated: + * * `config.softwareConfig.pypiPackages` + * * Replace all custom custom PyPI packages. If a replacement + * package map is not included in `environment`, all custom + * PyPI packages are cleared. It is an error to provide both + * this mask and a mask specifying an individual package. + * * `config.softwareConfig.pypiPackages.`packagename + * * Update the custom PyPI package *packagename*, + * preserving other packages. To delete the package, include it in + * `updateMask`, and omit the mapping for it in + * `environment.config.softwareConfig.pypiPackages`. It is an error + * to provide both a mask of this form and the + * `config.softwareConfig.pypiPackages` mask. + * * `labels` + * * Replace all environment labels. If a replacement labels map is not + * included in `environment`, all labels are cleared. It is an error to + * provide both this mask and a mask specifying one or more individual + * labels. + * * `labels.`labelName + * * Set the label named *labelName*, while preserving other + * labels. To delete the label, include it in `updateMask` and omit its + * mapping in `environment.labels`. It is an error to provide both a + * mask of this form and the `labels` mask. + * * `config.nodeCount` + * * Horizontally scale the number of nodes in the environment. An integer + * greater than or equal to 3 must be provided in the `config.nodeCount` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` + * * Replace the environment's current `WebServerNetworkAccessControl`. + * * `config.softwareConfig.airflowConfigOverrides` + * * Replace all Apache Airflow config overrides. If a replacement config + * overrides map is not included in `environment`, all config overrides + * are cleared. + * It is an error to provide both this mask and a mask specifying one or + * more individual config overrides. + * * `config.softwareConfig.airflowConfigOverrides.`section-name + * * Override the Apache Airflow config property *name* in the + * section named *section*, preserving other properties. To + * delete the property override, include it in `updateMask` and omit its + * mapping in + * `environment.config.softwareConfig.airflowConfigOverrides`. + * It is an error to provide both a mask of this form and the + * `config.softwareConfig.airflowConfigOverrides` mask. + * * `config.softwareConfig.envVariables` + * * Replace all environment variables. If a replacement environment + * variable map is not included in `environment`, all custom environment + * variables are cleared. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + */ + // const updateMask = {} + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callUpdateEnvironment() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEnvironment(); + // [END composer_v1_generated_Environments_UpdateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js new file mode 100644 index 00000000000..718176b5a60 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js @@ -0,0 +1,75 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1_generated_ImageVersions_ListImageVersions_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. + */ + /** + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + */ + // const parent = 'abc123' + /** + * The maximum number of image_versions to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * Whether or not image versions from old releases should be included. + */ + // const includePastReleases = true + + // Imports the Service library + const {ImageVersionsClient} = require('@google-cloud/orchestration-airflow').v1; + + // Instantiates a client + const serviceClient = new ImageVersionsClient(); + + async function callListImageVersions() { + // Construct request + const request = { + }; + + // Run request + const iterable = await serviceClient.listImageVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListImageVersions(); + // [END composer_v1_generated_ImageVersions_ListImageVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json new file mode 100644 index 00000000000..b304ff613b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json @@ -0,0 +1,391 @@ +{ + "clientLibrary": { + "name": "nodejs-service", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.orchestration.airflow.service.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "composer_v1_generated_Environments_CreateEnvironment_async", + "title": "Environments createEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Create a new environment.", + "canonical": true, + "file": "environments.create_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CreateEnvironment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "environment", + "type": ".google.cloud.orchestration.airflow.service.v1.Environment" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CreateEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_GetEnvironment_async", + "title": "Environments getEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Get an existing environment.", + "canonical": true, + "file": "environments.get_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.GetEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.Environment", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.GetEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_ListEnvironments_async", + "title": "Environments listEnvironments Sample", + "origin": "API_DEFINITION", + "description": " List environments.", + "canonical": true, + "file": "environments.list_environments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ListEnvironments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ListEnvironments", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_UpdateEnvironment_async", + "title": "Environments updateEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Update an environment.", + "canonical": true, + "file": "environments.update_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 176, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.UpdateEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "environment", + "type": ".google.cloud.orchestration.airflow.service.v1.Environment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.UpdateEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_DeleteEnvironment_async", + "title": "Environments deleteEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Delete an environment.", + "canonical": true, + "file": "environments.delete_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DeleteEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DeleteEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_SaveSnapshot_async", + "title": "Environments saveSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", + "canonical": true, + "file": "environments.save_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_LoadSnapshot_async", + "title": "Environments loadSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", + "canonical": true, + "file": "environments.load_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_path", + "type": "TYPE_STRING" + }, + { + "name": "skip_pypi_packages_installation", + "type": "TYPE_BOOL" + }, + { + "name": "skip_environment_variables_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_airflow_overrides_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_gcs_data_copying", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_ImageVersions_ListImageVersions_async", + "title": "Environments listImageVersions Sample", + "origin": "API_DEFINITION", + "description": " List ImageVersions for provided location.", + "canonical": true, + "file": "image_versions.list_image_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "include_past_releases", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse", + "client": { + "shortName": "ImageVersionsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersionsClient" + }, + "method": { + "shortName": "ListImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersions", + "service": { + "shortName": "ImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts new file mode 100644 index 00000000000..7907a6be7f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts @@ -0,0 +1,27 @@ +// 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 +// +// 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 v1 from './v1'; +const EnvironmentsClient = v1.EnvironmentsClient; +type EnvironmentsClient = v1.EnvironmentsClient; +const ImageVersionsClient = v1.ImageVersionsClient; +type ImageVersionsClient = v1.ImageVersionsClient; +export {v1, EnvironmentsClient, ImageVersionsClient}; +export default {v1, EnvironmentsClient, ImageVersionsClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts new file mode 100644 index 00000000000..f6c5a68bb50 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts @@ -0,0 +1,1473 @@ +// 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 +// +// 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/environments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './environments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Managed Apache Airflow Environments. + * @class + * @memberof v1 + */ +export class EnvironmentsClient { + 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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + environmentsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EnvironmentsClient. + * + * @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/main/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] + * @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 {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @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}. + * @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 EnvironmentsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EnvironmentsClient; + 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 = 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. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + 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 ? gaxInstance.fallback : gaxInstance; + + // 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. + this._opts = opts; + + // 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; + } + + // Determine the client header string. + 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/${this._gaxModule.version}`); + } + 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}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/environments/{environment}' + ), + }; + + // 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 = { + listEnvironments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'environments') + }; + + 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.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.Environment') as gax.protobuf.Type; + const createEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; + const updateEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.Environment') as gax.protobuf.Type; + const updateEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; + const deleteEnvironmentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; + const saveSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse') as gax.protobuf.Type; + const saveSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; + const loadSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse') as gax.protobuf.Type; + const loadSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEnvironmentResponse.decode.bind(createEnvironmentResponse), + createEnvironmentMetadata.decode.bind(createEnvironmentMetadata)), + updateEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), + updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata)), + deleteEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), + deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata)), + saveSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + saveSnapshotResponse.decode.bind(saveSnapshotResponse), + saveSnapshotMetadata.decode.bind(saveSnapshotMetadata)), + loadSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadSnapshotResponse.decode.bind(loadSnapshotResponse), + loadSnapshotMetadata.decode.bind(loadSnapshotMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.orchestration.airflow.service.v1.Environments', 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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.environmentsStub) { + return this.environmentsStub; + } + + // Put together the "service stub" for + // google.cloud.orchestration.airflow.service.v1.Environments. + this.environmentsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1.Environments') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.orchestration.airflow.service.v1.Environments, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const environmentsStubMethods = + ['createEnvironment', 'getEnvironment', 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', 'saveSnapshot', 'loadSnapshot']; + for (const methodName of environmentsStubMethods) { + const callPromise = this.environmentsStub.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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.environmentsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'composer.googleapis.com'; + } + + /** + * 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 'composer.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Get an existing environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource name of the environment to get, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. + * 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/v1/environments.get_environment.js + * region_tag:composer_v1_generated_Environments_GetEnvironment_async + */ + getEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|undefined, {}|undefined + ]>; + getEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): void; + getEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): void; + getEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEnvironment(request, options, callback); + } + +/** + * Create a new environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent must be of the form + * "projects/{projectId}/locations/{locationId}". + * @param {google.cloud.orchestration.airflow.service.v1.Environment} request.environment + * The environment 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/v1/environments.create_environment.js + * region_tag:composer_v1_generated_Environments_CreateEnvironment_async + */ + createEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEnvironment()`. + * @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 include:samples/generated/v1/environments.create_environment.js + * region_tag:composer_v1_generated_Environments_CreateEnvironment_async + */ + async checkCreateEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update an environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The relative resource name of the environment to update, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {google.cloud.orchestration.airflow.service.v1.Environment} request.environment + * A patch environment. Fields specified by the `updateMask` will be copied + * from the patch environment into the environment under update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A comma-separated list of paths, relative to `Environment`, of + * fields to update. + * For example, to set the version of scikit-learn to install in the + * environment to 0.19.0 and to remove an existing installation of + * numpy, the `updateMask` parameter would include the following two + * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * "config.softwareConfig.pypiPackages.numpy". The included patch + * environment would specify the scikit-learn version as follows: + * + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "scikit-learn":"==0.19.0" + * } + * } + * } + * } + * + * Note that in the above example, any existing PyPI packages + * other than scikit-learn and numpy will be unaffected. + * + * Only one update type may be included in a single request's `updateMask`. + * For example, one cannot update both the PyPI packages and + * labels in the same request. However, it is possible to update multiple + * members of a map field simultaneously in the same request. For example, + * to set the labels "label1" and "label2" while clearing "label3" (assuming + * it already exists), one can + * provide the paths "labels.label1", "labels.label2", and "labels.label3" + * and populate the patch environment as follows: + * + * { + * "labels":{ + * "label1":"new-label1-value" + * "label2":"new-label2-value" + * } + * } + * + * Note that in the above example, any existing labels that are not + * included in the `updateMask` will be unaffected. + * + * It is also possible to replace an entire map field by providing the + * map field's path in the `updateMask`. The new value of the field will + * be that which is provided in the patch environment. For example, to + * delete all pre-existing user-specified PyPI packages and + * install botocore at version 1.7.14, the `updateMask` would contain + * the path "config.softwareConfig.pypiPackages", and + * the patch environment would be the following: + * + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "botocore":"==1.7.14" + * } + * } + * } + * } + * + * **Note:** Only the following fields can be updated: + * + * * `config.softwareConfig.pypiPackages` + * * Replace all custom custom PyPI packages. If a replacement + * package map is not included in `environment`, all custom + * PyPI packages are cleared. It is an error to provide both + * this mask and a mask specifying an individual package. + * * `config.softwareConfig.pypiPackages.`packagename + * * Update the custom PyPI package *packagename*, + * preserving other packages. To delete the package, include it in + * `updateMask`, and omit the mapping for it in + * `environment.config.softwareConfig.pypiPackages`. It is an error + * to provide both a mask of this form and the + * `config.softwareConfig.pypiPackages` mask. + * * `labels` + * * Replace all environment labels. If a replacement labels map is not + * included in `environment`, all labels are cleared. It is an error to + * provide both this mask and a mask specifying one or more individual + * labels. + * * `labels.`labelName + * * Set the label named *labelName*, while preserving other + * labels. To delete the label, include it in `updateMask` and omit its + * mapping in `environment.labels`. It is an error to provide both a + * mask of this form and the `labels` mask. + * * `config.nodeCount` + * * Horizontally scale the number of nodes in the environment. An integer + * greater than or equal to 3 must be provided in the `config.nodeCount` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` + * * Replace the environment's current `WebServerNetworkAccessControl`. + * * `config.softwareConfig.airflowConfigOverrides` + * * Replace all Apache Airflow config overrides. If a replacement config + * overrides map is not included in `environment`, all config overrides + * are cleared. + * It is an error to provide both this mask and a mask specifying one or + * more individual config overrides. + * * `config.softwareConfig.airflowConfigOverrides.`section-name + * * Override the Apache Airflow config property *name* in the + * section named *section*, preserving other properties. To + * delete the property override, include it in `updateMask` and omit its + * mapping in + * `environment.config.softwareConfig.airflowConfigOverrides`. + * It is an error to provide both a mask of this form and the + * `config.softwareConfig.airflowConfigOverrides` mask. + * * `config.softwareConfig.envVariables` + * * Replace all environment variables. If a replacement environment + * variable map is not included in `environment`, all custom environment + * variables are cleared. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + * @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/v1/environments.update_environment.js + * region_tag:composer_v1_generated_Environments_UpdateEnvironment_async + */ + updateEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateEnvironment()`. + * @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 include:samples/generated/v1/environments.update_environment.js + * region_tag:composer_v1_generated_Environments_UpdateEnvironment_async + */ + async checkUpdateEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Delete an environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The environment to delete, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @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/v1/environments.delete_environment.js + * region_tag:composer_v1_generated_Environments_DeleteEnvironment_async + */ + deleteEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEnvironment()`. + * @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 include:samples/generated/v1/environments.delete_environment.js + * region_tag:composer_v1_generated_Environments_DeleteEnvironment_async + */ + async checkDeleteEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a snapshots of a Cloud Composer environment. + * + * As a result of this operation, snapshot of environment's state is stored + * in a location specified in the SaveSnapshotRequest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotLocation + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + * @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/v1/environments.save_snapshot.js + * region_tag:composer_v1_generated_Environments_SaveSnapshot_async + */ + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'environment': request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.saveSnapshot(request, options, callback); + } +/** + * Check the status of the long running operation returned by `saveSnapshot()`. + * @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 include:samples/generated/v1/environments.save_snapshot.js + * region_tag:composer_v1_generated_Environments_SaveSnapshot_async + */ + async checkSaveSnapshotProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.saveSnapshot, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Loads a snapshot of a Cloud Composer environment. + * + * As a result of this operation, a snapshot of environment's specified in + * LoadSnapshotRequest is loaded into the environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotPath + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + * @param {boolean} request.skipPypiPackagesInstallation + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + * @param {boolean} request.skipEnvironmentVariablesSetting + * Whether or not to skip setting environment variables when loading the + * environment's state. + * @param {boolean} request.skipAirflowOverridesSetting + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + * @param {boolean} request.skipGcsDataCopying + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + * @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/v1/environments.load_snapshot.js + * region_tag:composer_v1_generated_Environments_LoadSnapshot_async + */ + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'environment': request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.loadSnapshot(request, options, callback); + } +/** + * Check the status of the long running operation returned by `loadSnapshot()`. + * @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 include:samples/generated/v1/environments.load_snapshot.js + * region_tag:composer_v1_generated_Environments_LoadSnapshot_async + */ + async checkLoadSnapshotProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.loadSnapshot, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List environments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. + * 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. + * Note that it can affect your quota. + * We recommend using `listEnvironmentsAsync()` + * 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. + */ + listEnvironments( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[], + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse + ]>; + listEnvironments( + request: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): void; + listEnvironments( + request: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): void; + listEnvironments( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>, + callback?: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[], + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEnvironments(request, options, callback); + } + +/** + * 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 + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment} 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 `listEnvironmentsAsync()` + * 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. + */ + listEnvironmentsStream( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.createStream( + this.innerApiCalls.listEnvironments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEnvironments`, 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 + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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). + * When you iterate the returned iterable, each element will be an object representing + * [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. 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 include:samples/generated/v1/environments.list_environments.js + * region_tag:composer_v1_generated_Environments_ListEnvironments_async + */ + listEnvironmentsAsync( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.asyncIterate( + this.innerApiCalls['listEnvironments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {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 {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project:string,location:string,environment:string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).location; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; + } + + /** + * 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 { + if (this.environmentsStub && !this._terminated) { + return this.environmentsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json new file mode 100644 index 00000000000..2f3d92af1f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.orchestration.airflow.service.v1.Environments": { + "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": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEnvironments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SaveSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LoadSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json new file mode 100644 index 00000000000..674df9932cf --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/orchestration/airflow/service/v1/environments.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1/operations.proto" +] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..0bb4722298e --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json @@ -0,0 +1,125 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.orchestration.airflow.service.v1", + "libraryPackage": "@google-cloud/orchestration-airflow", + "services": { + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + } + } + } + } + }, + "ImageVersions": { + "clients": { + "grpc": { + "libraryClient": "ImageVersionsClient", + "rpcs": { + "ListImageVersions": { + "methods": [ + "listImageVersions", + "listImageVersionsStream", + "listImageVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ImageVersionsClient", + "rpcs": { + "ListImageVersions": { + "methods": [ + "listImageVersions", + "listImageVersionsStream", + "listImageVersionsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts new file mode 100644 index 00000000000..cde3ada51ca --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts @@ -0,0 +1,557 @@ +// 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 +// +// 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/image_versions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './image_versions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Readonly service to query available ImageVersions. + * @class + * @memberof v1 + */ +export class ImageVersionsClient { + 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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + imageVersionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ImageVersionsClient. + * + * @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/main/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] + * @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 {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @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}. + * @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 ImageVersionsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ImageVersionsClient; + 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 = 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. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + 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 ? gaxInstance.fallback : gaxInstance; + + // 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. + this._opts = opts; + + // 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; + } + + // Determine the client header string. + 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/${this._gaxModule.version}`); + } + 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}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/environments/{environment}' + ), + }; + + // 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 = { + listImageVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'imageVersions') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.orchestration.airflow.service.v1.ImageVersions', 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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.imageVersionsStub) { + return this.imageVersionsStub; + } + + // Put together the "service stub" for + // google.cloud.orchestration.airflow.service.v1.ImageVersions. + this.imageVersionsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1.ImageVersions') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.orchestration.airflow.service.v1.ImageVersions, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const imageVersionsStubMethods = + ['listImageVersions']; + for (const methodName of imageVersionsStubMethods) { + const callPromise = this.imageVersionsStub.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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.imageVersionsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'composer.googleapis.com'; + } + + /** + * 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 'composer.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * List ImageVersions for provided location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion}. + * 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. + * Note that it can affect your quota. + * We recommend using `listImageVersionsAsync()` + * 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. + */ + listImageVersions( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[], + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse + ]>; + listImageVersions( + request: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): void; + listImageVersions( + request: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): void; + listImageVersions( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>, + callback?: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[], + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listImageVersions(request, options, callback); + } + +/** + * 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 + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion} 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 `listImageVersionsAsync()` + * 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. + */ + listImageVersionsStream( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listImageVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listImageVersions.createStream( + this.innerApiCalls.listImageVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listImageVersions`, 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 + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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). + * When you iterate the returned iterable, each element will be an object representing + * [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion}. 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 include:samples/generated/v1/image_versions.list_image_versions.js + * region_tag:composer_v1_generated_ImageVersions_ListImageVersions_async + */ + listImageVersionsAsync( + request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listImageVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listImageVersions.asyncIterate( + this.innerApiCalls['listImageVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project:string,location:string,environment:string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).location; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; + } + + /** + * 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 { + if (this.imageVersionsStub && !this._terminated) { + return this.imageVersionsStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json new file mode 100644 index 00000000000..6ae2b5fc9c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.orchestration.airflow.service.v1.ImageVersions": { + "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": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListImageVersions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json new file mode 100644 index 00000000000..674df9932cf --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/orchestration/airflow/service/v1/environments.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1/operations.proto" +] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts new file mode 100644 index 00000000000..9a109a1d699 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// 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 {EnvironmentsClient} from './environments_client'; +export {ImageVersionsClient} from './image_versions_client'; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3d4b3363bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 +// +// 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 service = require('@google-cloud/orchestration-airflow'); + +function main() { + const environmentsClient = new service.EnvironmentsClient(); + const imageVersionsClient = new service.ImageVersionsClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..63551cdc1e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// 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 +// +// 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 {EnvironmentsClient, ImageVersionsClient} from '@google-cloud/orchestration-airflow'; + +// check that the client class type name can be used +function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { + client.close(); +} +function doStuffWithImageVersionsClient(client: ImageVersionsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const environmentsClient = new EnvironmentsClient(); + doStuffWithEnvironmentsClient(environmentsClient); + // check that the client instance can be created + const imageVersionsClient = new ImageVersionsClient(); + doStuffWithImageVersionsClient(imageVersionsClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts new file mode 100644 index 00000000000..557a57558e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// 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'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts new file mode 100644 index 00000000000..4986a5cb314 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts @@ -0,0 +1,1640 @@ +// 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 +// +// 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 environmentsModule from '../src'; + +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) + .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('v1.EnvironmentsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = environmentsModule.v1.EnvironmentsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = environmentsModule.v1.EnvironmentsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = environmentsModule.v1.EnvironmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new environmentsModule.v1.EnvironmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + await client.initialize(); + assert(client.environmentsStub); + }); + + it('has close method for the initialized client', done => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.environmentsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new environmentsModule.v1.EnvironmentsClient({ + 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 environmentsModule.v1.EnvironmentsClient({ + 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('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with closed client', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEnvironment(request), expectedError); + }); + }); + + describe('createEnvironment', () => { + it('invokes createEnvironment without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEnvironment( + 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); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkCreateEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkCreateEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateEnvironment', () => { + it('invokes updateEnvironment without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnvironment( + 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); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkUpdateEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkUpdateEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEnvironment', () => { + it('invokes deleteEnvironment without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEnvironment( + 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); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkDeleteEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkDeleteEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('saveSnapshot', () => { + it('invokes saveSnapshot without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.saveSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.saveSnapshot( + 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); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.saveSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.saveSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSaveSnapshotProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSaveSnapshotProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('loadSnapshot', () => { + it('invokes loadSnapshot without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadSnapshot( + 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); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.loadSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.loadSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadSnapshotProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadSnapshotProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listEnvironments', () => { + it('invokes listEnvironments without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); + const [response] = await client.listEnvironments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnvironments( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnvironments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEnvironments(request), expectedError); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironmentsStream without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + ]; + client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.Environment[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.Environment) => { + 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.listEnvironments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEnvironmentsStream with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.Environment[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.Environment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), + ]; + client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[] = []; + const iterable = client.listEnvironmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEnvironmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('environment', () => { + const fakePath = "/rendered/path/environment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + environment: "environmentValue", + }; + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, "environmentValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts new file mode 100644 index 00000000000..74c06368f17 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts @@ -0,0 +1,491 @@ +// 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 +// +// 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 imageversionsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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) + .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 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('v1.ImageVersionsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = imageversionsModule.v1.ImageVersionsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = imageversionsModule.v1.ImageVersionsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = imageversionsModule.v1.ImageVersionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new imageversionsModule.v1.ImageVersionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.imageVersionsStub, undefined); + await client.initialize(); + assert(client.imageVersionsStub); + }); + + it('has close method for the initialized client', done => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.imageVersionsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.imageVersionsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new imageversionsModule.v1.ImageVersionsClient({ + 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 imageversionsModule.v1.ImageVersionsClient({ + 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('listImageVersions', () => { + it('invokes listImageVersions without error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + ]; + client.innerApiCalls.listImageVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listImageVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersions without error using callback', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + ]; + client.innerApiCalls.listImageVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listImageVersions( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersions with error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listImageVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listImageVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersionsStream without error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + ]; + client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listImageVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion) => { + 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.listImageVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); + assert( + (client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listImageVersionsStream with error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listImageVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); + assert( + (client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listImageVersions without error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), + ]; + client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[] = []; + const iterable = client.listImageVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listImageVersions with error', async () => { + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listImageVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('environment', () => { + const fakePath = "/rendered/path/environment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + environment: "environmentValue", + }; + const client = new imageversionsModule.v1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, "environmentValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js new file mode 100644 index 00000000000..9b7becac60a --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js @@ -0,0 +1,64 @@ +// 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 +// +// 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Environments', + filename: './environments.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + 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/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js new file mode 100644 index 00000000000..4eacd7d3697 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// 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 +// +// 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'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/orchestration-airflow', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js new file mode 100644 index 00000000000..481c522b00f --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// 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 +// +// 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. ** + +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 diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js new file mode 100644 index 00000000000..494e147865d --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// 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 +// +// 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md new file mode 100644 index 00000000000..536af38a9bb --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md @@ -0,0 +1 @@ +Service: Nodejs Client diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json new file mode 100644 index 00000000000..05f03ef3726 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json @@ -0,0 +1,65 @@ +{ + "name": "@google-cloud/orchestration-airflow", + "version": "0.1.0", + "description": "Service client for Node.js", + "repository": "googleapis/nodejs-service", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google service", + "service", + "environments", + "image versions" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.62", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto new file mode 100644 index 00000000000..b2797ea7a41 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto @@ -0,0 +1,1305 @@ +// 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 +// +// 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.orchestration.airflow.service.v1beta1; + +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/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; +option java_multiple_files = true; +option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; + +// Managed Apache Airflow Environments. +service Environments { + option (google.api.default_host) = "composer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a new environment. + rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/environments" + body: "environment" + }; + option (google.api.method_signature) = "parent,environment"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Get an existing environment. + rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List environments. + rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/environments" + }; + option (google.api.method_signature) = "parent"; + } + + // Update an environment. + rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/locations/*/environments/*}" + body: "environment" + }; + option (google.api.method_signature) = "name,environment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Delete an environment. + rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/environments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Restart Airflow web server. + rpc RestartWebServer(RestartWebServerRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Environment" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Check if an upgrade operation on the environment will succeed. + // + // In case of problems detailed info can be found in the returned Operation. + rpc CheckUpgrade(CheckUpgradeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Creates a snapshots of a Cloud Composer environment. + // + // As a result of this operation, snapshot of environment's state is stored + // in a location specified in the SaveSnapshotRequest. + rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Loads a snapshot of a Cloud Composer environment. + // + // As a result of this operation, a snapshot of environment's specified in + // LoadSnapshotRequest is loaded into the environment. + rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } +} + +// Create a new environment. +message CreateEnvironmentRequest { + // The parent must be of the form + // "projects/{projectId}/locations/{locationId}". + string parent = 1; + + // The environment to create. + Environment environment = 2; +} + +// Get an environment. +message GetEnvironmentRequest { + // The resource name of the environment to get, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 1; +} + +// List environments in a project and location. +message ListEnvironmentsRequest { + // List environments in the given project and location, in the form: + // "projects/{projectId}/locations/{locationId}" + string parent = 1; + + // The maximum number of environments to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// The environments in a project and location. +message ListEnvironmentsResponse { + // The list of environments returned by a ListEnvironmentsRequest. + repeated Environment environments = 1; + + // The page token used to query for the next page if one exists. + string next_page_token = 2; +} + +// Delete an environment. +message DeleteEnvironmentRequest { + // The environment to delete, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 1; +} + +// Update an environment. +message UpdateEnvironmentRequest { + // The relative resource name of the environment to update, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 2; + + // A patch environment. Fields specified by the `updateMask` will be copied + // from the patch environment into the environment under update. + Environment environment = 1; + + // Required. A comma-separated list of paths, relative to `Environment`, of + // fields to update. + // For example, to set the version of scikit-learn to install in the + // environment to 0.19.0 and to remove an existing installation of + // argparse, the `updateMask` parameter would include the following two + // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + // "config.softwareConfig.pypiPackages.argparse". The included patch + // environment would specify the scikit-learn version as follows: + // + // { + // "config":{ + // "softwareConfig":{ + // "pypiPackages":{ + // "scikit-learn":"==0.19.0" + // } + // } + // } + // } + // + // Note that in the above example, any existing PyPI packages + // other than scikit-learn and argparse will be unaffected. + // + // Only one update type may be included in a single request's `updateMask`. + // For example, one cannot update both the PyPI packages and + // labels in the same request. However, it is possible to update multiple + // members of a map field simultaneously in the same request. For example, + // to set the labels "label1" and "label2" while clearing "label3" (assuming + // it already exists), one can + // provide the paths "labels.label1", "labels.label2", and "labels.label3" + // and populate the patch environment as follows: + // + // { + // "labels":{ + // "label1":"new-label1-value" + // "label2":"new-label2-value" + // } + // } + // + // Note that in the above example, any existing labels that are not + // included in the `updateMask` will be unaffected. + // + // It is also possible to replace an entire map field by providing the + // map field's path in the `updateMask`. The new value of the field will + // be that which is provided in the patch environment. For example, to + // delete all pre-existing user-specified PyPI packages and + // install botocore at version 1.7.14, the `updateMask` would contain + // the path "config.softwareConfig.pypiPackages", and + // the patch environment would be the following: + // + // { + // "config":{ + // "softwareConfig":{ + // "pypiPackages":{ + // "botocore":"==1.7.14" + // } + // } + // } + // } + // + // **Note:** Only the following fields can be updated: + // + // * `config.softwareConfig.pypiPackages` + // * Replace all custom custom PyPI packages. If a replacement + // package map is not included in `environment`, all custom + // PyPI packages are cleared. It is an error to provide both + // this mask and a mask specifying an individual package. + // * `config.softwareConfig.pypiPackages.`packagename + // * Update the custom PyPI package *packagename*, + // preserving other packages. To delete the package, include it in + // `updateMask`, and omit the mapping for it in + // `environment.config.softwareConfig.pypiPackages`. It is an error + // to provide both a mask of this form and the + // `config.softwareConfig.pypiPackages` mask. + // * `labels` + // * Replace all environment labels. If a replacement labels map is not + // included in `environment`, all labels are cleared. It is an error to + // provide both this mask and a mask specifying one or more individual + // labels. + // * `labels.`labelName + // * Set the label named *labelName*, while preserving other + // labels. To delete the label, include it in `updateMask` and omit its + // mapping in `environment.labels`. It is an error to provide both a + // mask of this form and the `labels` mask. + // * `config.nodeCount` + // * Horizontally scale the number of nodes in the environment. An integer + // greater than or equal to 3 must be provided in the `config.nodeCount` + // field. Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + // * `config.webServerNetworkAccessControl` + // * Replace the environment's current WebServerNetworkAccessControl. + // * `config.softwareConfig.airflowConfigOverrides` + // * Replace all Apache Airflow config overrides. If a replacement config + // overrides map is not included in `environment`, all config overrides + // are cleared. + // It is an error to provide both this mask and a mask specifying one or + // more individual config overrides. + // * `config.softwareConfig.airflowConfigOverrides.`section-name + // * Override the Apache Airflow config property *name* in the + // section named *section*, preserving other properties. To + // delete the property override, include it in `updateMask` and omit its + // mapping in + // `environment.config.softwareConfig.airflowConfigOverrides`. + // It is an error to provide both a mask of this form and the + // `config.softwareConfig.airflowConfigOverrides` mask. + // * `config.softwareConfig.envVariables` + // * Replace all environment variables. If a replacement environment + // variable map is not included in `environment`, all custom environment + // variables are cleared. + // * `config.softwareConfig.imageVersion` + // * Upgrade the version of the environment in-place. Refer to + // `SoftwareConfig.image_version` for information on how to format the + // new image version. Additionally, the new image version cannot effect + // a version downgrade, and must match the current image version's + // Composer and Airflow major versions. Consult the [Cloud Composer + // version list](/composer/docs/concepts/versioning/composer-versions) + // for valid values. + // * `config.softwareConfig.schedulerCount` + // * Horizontally scale the number of schedulers in Airflow. A positive + // integer not greater than the number of nodes must be provided in the + // `config.softwareConfig.schedulerCount` field. Supported for Cloud + // Composer environments in versions composer-1.*.*-airflow-2.*.*. + // * `config.softwareConfig.cloudDataLineageIntegration` + // * Configuration for Cloud Data Lineage integration. + // * `config.databaseConfig.machineType` + // * Cloud SQL machine type used by Airflow database. + // It has to be one of: db-n1-standard-2, db-n1-standard-4, + // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + // environments in versions composer-1.*.*-airflow-*.*.*. + // * `config.webServerConfig.machineType` + // * Machine type on which Airflow web server is running. + // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + // or composer-n1-webserver-8. Supported for Cloud Composer environments + // in versions composer-1.*.*-airflow-*.*.*. + // * `config.maintenanceWindow` + // * Maintenance window during which Cloud Composer components may be + // under maintenance. + // * `config.workloadsConfig` + // * The workloads configuration settings for the GKE cluster associated + // with the Cloud Composer environment. Supported for Cloud Composer + // environments in versions composer-2.*.*-airflow-*.*.* and newer. + // * `config.environmentSize` + // * The size of the Cloud Composer environment. Supported for Cloud + // Composer environments in versions composer-2.*.*-airflow-*.*.* and + // newer. + google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Restart Airflow web server. +message RestartWebServerRequest { + // The resource name of the environment to restart the web server for, in the + // form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string name = 1; +} + +// Response to ExecuteAirflowCommandRequest. +message ExecuteAirflowCommandResponse { + // The unique ID of the command execution for polling. + string execution_id = 1; + + // The name of the pod where the command is executed. + string pod = 2; + + // The namespace of the pod where the command is executed. + string pod_namespace = 3; + + // Error message. Empty if there was no error. + string error = 4; +} + +// Response to PollAirflowCommandRequest. +message PollAirflowCommandResponse { + // Contains information about a single line from logs. + message Line { + // Number of the line. + int32 line_number = 1; + + // Text content of the log line. + string content = 2; + } + + // Information about how a command ended. + message ExitInfo { + // The exit code from the command execution. + int32 exit_code = 1; + + // Error message. Empty if there was no error. + string error = 2; + } + + // Output from the command execution. It may not contain the full output + // and the caller may need to poll for more lines. + repeated Line output = 1; + + // Whether the command execution has finished and there is no more output. + bool output_end = 2; + + // The result exit status of the command. + ExitInfo exit_info = 3; +} + +// Request to create a snapshot of a Cloud Composer environment. +message SaveSnapshotRequest { + // The resource name of the source environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + // "gs://my-bucket/snapshots". + string snapshot_location = 2; +} + +// Response to SaveSnapshotRequest. +message SaveSnapshotResponse { + // The fully-resolved Cloud Storage path of the created snapshot, + // e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + // This field is populated only if the snapshot creation was successful. + string snapshot_path = 1; +} + +// Request to load a snapshot into a Cloud Composer environment. +message LoadSnapshotRequest { + // The resource name of the target environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // A Cloud Storage path to a snapshot to load, e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + string snapshot_path = 2; + + // Whether or not to skip installing Pypi packages when loading the + // environment's state. + bool skip_pypi_packages_installation = 3; + + // Whether or not to skip setting environment variables when loading the + // environment's state. + bool skip_environment_variables_setting = 4; + + // Whether or not to skip setting Airflow overrides when loading the + // environment's state. + bool skip_airflow_overrides_setting = 5; + + // Whether or not to skip copying Cloud Storage data when loading the + // environment's state. + bool skip_gcs_data_copying = 6; +} + +// Response to LoadSnapshotRequest. +message LoadSnapshotResponse { + +} + +// Configuration information for an environment. +message EnvironmentConfig { + // The size of the Cloud Composer environment. + enum EnvironmentSize { + // The size of the environment is unspecified. + ENVIRONMENT_SIZE_UNSPECIFIED = 0; + + // The environment size is small. + ENVIRONMENT_SIZE_SMALL = 1; + + // The environment size is medium. + ENVIRONMENT_SIZE_MEDIUM = 2; + + // The environment size is large. + ENVIRONMENT_SIZE_LARGE = 3; + } + + // Output only. The Kubernetes Engine cluster used to run this environment. + string gke_cluster = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud + // Storage objects reside in a flat namespace, a hierarchical file tree + // can be simulated using "/"-delimited object name prefixes. DAG objects for + // this environment reside in a simulated directory with the given prefix. + string dag_gcs_prefix = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The number of nodes in the Kubernetes Engine cluster that will be + // used to run this environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + int32 node_count = 3; + + // The configuration settings for software inside the environment. + SoftwareConfig software_config = 4; + + // The configuration used for the Kubernetes Engine cluster. + NodeConfig node_config = 5; + + // The configuration used for the Private IP Cloud Composer environment. + PrivateEnvironmentConfig private_environment_config = 7; + + // Optional. The network-level access control policy for the Airflow web server. If + // unspecified, no network-level access restrictions will be applied. + WebServerNetworkAccessControl web_server_network_access_control = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration settings for Cloud SQL instance used internally by Apache + // Airflow software. + DatabaseConfig database_config = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration settings for the Airflow web server App Engine instance. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + WebServerConfig web_server_config = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see + // [Airflow web + // interface](/composer/docs/how-to/accessing/airflow-web-interface)). + string airflow_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The encryption options for the Cloud Composer environment and its + // dependencies. Cannot be updated. + EncryptionConfig encryption_config = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance window is the period when Cloud Composer components may + // undergo maintenance. It is defined so that maintenance is not executed + // during peak hours or critical time periods. + // + // The system will not be under maintenance for every occurrence of this + // window, but when maintenance is planned, it will be scheduled + // during the window. + // + // The maintenance window period must encompass at least 12 hours per week. + // This may be split into multiple chunks, each with a size of + // at least 4 hours. + // + // If this value is omitted, Cloud Composer components may be subject to + // maintenance at any time. + MaintenanceWindow maintenance_window = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The workloads configuration settings for the GKE cluster associated with + // the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web + // server and workers workloads. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + WorkloadsConfig workloads_config = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the Cloud Composer environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration options for GKE cluster master authorized networks. + // By default master authorized networks feature is: + // - in case of private environment: enabled with no external networks + // allowlisted. + // - in case of public environment: disabled. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Recovery settings configuration of an environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; +} + +// Network-level access control policy for the Airflow web server. +message WebServerNetworkAccessControl { + // Allowed IP range with user-provided description. + message AllowedIpRange { + // IP address or range, defined using CIDR notation, of requests that this + // rule applies to. + // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` + // or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. + // + // IP range prefixes should be properly truncated. For example, + // `1.2.3.4/24` should be truncated to `1.2.3.0/24`. Similarly, for IPv6, + // `2001:db8::1/32` should be truncated to `2001:db8::/32`. + string value = 1; + + // Optional. User-provided description. It must contain at most 300 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // A collection of allowed IP ranges with descriptions. + repeated AllowedIpRange allowed_ip_ranges = 1; +} + +// Specifies the selection and configuration of software inside the environment. +message SoftwareConfig { + // The version of the software running in the environment. + // This encapsulates both the version of Cloud Composer functionality and the + // version of Apache Airflow. It must match the regular expression + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. + // When used as input, the server also checks if the provided version is + // supported and denies the request for an unsupported version. + // + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. + // + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. + // + // In all cases, the resolved image version is stored in the same field. + // + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). + string image_version = 1; + + // Optional. Apache Airflow configuration properties to override. + // + // Property keys contain the section and property names, separated by a + // hyphen, for example "core-dags_are_paused_at_creation". Section names must + // not contain hyphens ("-"), opening square brackets ("["), or closing + // square brackets ("]"). The property name must not be empty and must not + // contain an equals sign ("=") or semicolon (";"). Section and property names + // must not contain a period ("."). Apache Airflow configuration property + // names must be written in + // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property values can + // contain any character, and can be written in any lower/upper case format. + // + // Certain Apache Airflow configuration property values are + // [blocked](/composer/docs/concepts/airflow-configurations), + // and cannot be overridden. + map airflow_config_overrides = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Custom Python Package Index (PyPI) packages to be installed in + // the environment. + // + // Keys refer to the lowercase package name such as "numpy" + // and values are the lowercase extras and version specifier such as + // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To specify a + // package without pinning it to a version specifier, use the empty string as + // the value. + map pypi_packages = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional environment variables to provide to the Apache Airflow + // scheduler, worker, and webserver processes. + // + // Environment variable names must match the regular expression + // `[a-zA-Z_][a-zA-Z0-9_]*`. They cannot specify Apache Airflow + // software configuration overrides (they cannot match the regular expression + // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of the + // following reserved names: + // + // * `AIRFLOW_HOME` + // * `C_FORCE_ROOT` + // * `CONTAINER_NAME` + // * `DAGS_FOLDER` + // * `GCP_PROJECT` + // * `GCS_BUCKET` + // * `GKE_CLUSTER_NAME` + // * `SQL_DATABASE` + // * `SQL_INSTANCE` + // * `SQL_PASSWORD` + // * `SQL_PROJECT` + // * `SQL_REGION` + // * `SQL_USER` + map env_variables = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The major version of Python used to run the Apache Airflow + // scheduler, worker, and webserver processes. + // + // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be + // updated. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // Python major version 3. + string python_version = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of schedulers for Airflow. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-2.*.*. + int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for Cloud Data Lineage integration. + CloudDataLineageIntegration cloud_data_lineage_integration = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for controlling how IPs are allocated in the +// GKE cluster. +message IPAllocationPolicy { + // Optional. Whether or not to enable Alias IPs in the GKE cluster. + // If `true`, a VPC-native cluster is created. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // VPC-native GKE clusters. + bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the cluster's secondary range used to allocate + // IP addresses to pods. Specify either `cluster_secondary_range_name` + // or `cluster_ipv4_cidr_block` but not both. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the services' secondary range used to allocate + // IP addresses to the cluster. Specify either `services_secondary_range_name` + // or `services_ipv4_cidr_block` but not both. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address range used to allocate IP addresses to pods in + // the cluster. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + // + // Set to blank to have GKE choose a range with the default size. + // + // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + // netmask. + // + // Set to a + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + // Specify `cluster_secondary_range_name` or `cluster_ipv4_cidr_block` + // but not both. + string cluster_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address range of the services IP addresses in this + // cluster. + // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. + // + // Set to blank to have GKE choose a range with the default size. + // + // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific + // netmask. + // + // Set to a + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + // to use. + // Specify `services_secondary_range_name` or `services_ipv4_cidr_block` + // but not both. + string services_ipv4_cidr_block = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration information for the Kubernetes Engine nodes running +// the Apache Airflow software. +message NodeConfig { + // Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which + // to deploy the VMs used to run the Apache Airflow software, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/zones/{zoneId}". + // + // This `location` must belong to the enclosing environment's project and + // location. If both this field and `nodeConfig.machineType` are specified, + // `nodeConfig.machineType` must belong to this `location`; if both are + // unspecified, the service will pick a zone in the Compute Engine region + // corresponding to the Cloud Composer location, and propagate that choice to + // both fields. If only one field (`location` or `nodeConfig.machineType`) is + // specified, the location information from the specified field will be + // propagated to the unspecified field. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string location = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine + // [machine type](/compute/docs/machine-types) used for cluster instances, + // specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTypeId}". + // + // The `machineType` must belong to the enclosing environment's project and + // location. If both this field and `nodeConfig.location` are specified, + // this `machineType` must belong to the `nodeConfig.location`; if both are + // unspecified, the service will pick a zone in the Compute Engine region + // corresponding to the Cloud Composer location, and propagate that choice to + // both fields. If exactly one of this field and `nodeConfig.location` is + // specified, the location information from the specified field will be + // propagated to the unspecified field. + // + // The `machineTypeId` must not be a [shared-core machine + // type](/compute/docs/machine-types#sharedcore). + // + // If this field is unspecified, the `machineTypeId` defaults + // to "n1-standard-1". + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string machine_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine network to be used for machine + // communications, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/global/networks/{networkId}". + // + // If unspecified, the default network in the environment's project is used. + // If a [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets) + // is provided, `nodeConfig.subnetwork` must also be provided. For + // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements, see + // `nodeConfig.subnetwork`. + string network = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine subnetwork to be used for machine + // communications, specified as a + // [relative resource + // name](/apis/design/resource_names#relative_resource_name). For example: + // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" + // + // If a subnetwork is provided, `nodeConfig.network` must also be provided, + // and the subnetwork must belong to the enclosing environment's project and + // location. + string subnetwork = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. + // If unspecified, defaults to 100GB. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + int32 disk_size_gb = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The set of Google API scopes to be made available on all + // node VMs. If `oauth_scopes` is empty, defaults to + // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + repeated string oauth_scopes = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Google Cloud Platform Service Account to be used by the workloads. If a + // service account is not specified, the "default" Compute Engine service + // account is used. Cannot be updated. + string service_account = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of instance tags applied to all node VMs. Tags are used + // to identify valid sources or targets for network firewalls. Each tag within + // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IPAllocationPolicy fields for the GKE cluster. + IPAllocationPolicy ip_allocation_policy = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of pods per node in the Cloud Composer GKE cluster. + // The value must be between 8 and 110 and it can be set only if + // the environment is VPC-native. + // The default value is 32. Values of this field will be propagated both to + // the `default-pool` node pool of the newly created GKE cluster, and to the + // default "Maximum Pods per Node" value which is used for newly created + // node pools if their value is not explicitly set during node pool creation. + // For more information, see [Optimizing IP address allocation] + // (https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr). + // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + int32 max_pods_per_node = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines + // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for + // all destination addresses, except between pods traffic. + // + // See: + // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent + bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the private GKE cluster in a Cloud Composer +// environment. +message PrivateClusterConfig { + // Optional. If `true`, access to the public endpoint of the GKE cluster is + // denied. + bool enable_private_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IPv4 range for GKE master will be reserved. If + // left blank, the default value of '172.16.0.0/23' is used. + string master_ipv4_cidr_block = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range in CIDR notation to use for the hosted master network. This + // range is used for assigning internal IP addresses to the cluster + // master or set of masters and to the internal load balancer virtual IP. + // This range must not overlap with any other ranges in use + // within the cluster's network. + string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration options for networking connections in the Composer 2 +// environment. +message NetworkingConfig { + // Represents connection type between Composer environment in Customer + // Project and the corresponding Tenant project, from a predefined list + // of available connection modes. + enum ConnectionType { + // No specific connection type was requested, so the environment uses + // the default value corresponding to the rest of its configuration. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Requests the use of VPC peerings for connecting the Customer and Tenant + // projects. + VPC_PEERING = 1; + + // Requests the use of Private Service Connect for connecting the Customer + // and Tenant projects. + PRIVATE_SERVICE_CONNECT = 2; + } + + // Optional. Indicates the user requested specifc connection type between Tenant and + // Customer projects. + // You cannot set networking connection type in public IP environment. + ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration information for configuring a Private IP Cloud Composer +// environment. +message PrivateEnvironmentConfig { + // Optional. If `true`, a Private IP Cloud Composer environment is created. + // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be + // set to true for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the private GKE cluster for a Private IP + // Cloud Composer environment. + PrivateClusterConfig private_cluster_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IP range for web server will be reserved. Needs + // to be disjoint from private_cluster_config.master_ipv4_cidr_block and + // cloud_sql_ipv4_cidr_block. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The CIDR block from which IP range in tenant project will be reserved for + // Cloud SQL. Needs to be disjoint from web_server_ipv4_cidr_block + string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range reserved for the tenant project's App Engine VMs. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant + // project will be reserved. Needs to be disjoint from + // private_cluster_config.master_ipv4_cidr_block and + // cloud_sql_ipv4_cidr_block. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_cidr_block = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range reserved for the tenant project's Cloud Composer network. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for + // `IPAllocationPolicy.cluster_ipv4_cidr_block` and + // `IPAllocationPolicy.service_ipv4_cidr_block`. + bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specified, the environment will use Private Service Connect + // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, + // and the PSC endpoint in the Customer Project will use an IP address from + // this subnetwork. + string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the network connections configuration in the environment. + NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration of Cloud SQL instance that is used by the Apache Airflow +// software. +message DatabaseConfig { + // Optional. Cloud SQL machine type used by Airflow database. + // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 + // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. + // Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration settings for the Airflow web server App Engine instance. +// Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. +message WebServerConfig { + // Optional. Machine type on which Airflow web server is running. + // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or + // composer-n1-webserver-8. + // If not specified, composer-n1-webserver-2 will be used. + // Value custom is returned only in response, if Airflow web server parameters + // were manually changed to a non-standard values. + string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The encryption options for the Cloud Composer environment and its +// dependencies. Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. +message EncryptionConfig { + // Optional. Customer-managed Encryption Key available through Google's Key Management + // Service. Cannot be updated. + // If not specified, Google-managed key will be used. + string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration settings for Cloud Composer maintenance window. +// The following example: +// +// ``` +// { +// "startTime":"2019-08-01T01:00:00Z" +// "endTime":"2019-08-01T07:00:00Z" +// "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE" +// } +// ``` +// +// would define a maintenance window between 01 and 07 hours UTC during +// each Tuesday and Wednesday. +message MaintenanceWindow { + // Required. Start time of the first recurrence of the maintenance window. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window end time. It is used only to calculate the duration of + // the maintenance window. + // The value for end_time must be in the future, relative to `start_time`. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window recurrence. Format is a subset of + // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed + // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...` + // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`. + string recurrence = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The Kubernetes workloads configuration for GKE cluster associated with the +// Cloud Composer environment. Supported for Cloud Composer environments in +// versions composer-2.*.*-airflow-*.*.* and newer. +message WorkloadsConfig { + // Configuration for resources used by Airflow schedulers. + message SchedulerResource { + // Optional. CPU request and limit for a single Airflow scheduler replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow scheduler replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow scheduler replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of schedulers. + int32 count = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow web server. + message WebServerResource { + // Optional. CPU request and limit for Airflow web server. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for Airflow web server. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for Airflow web server. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow workers. + message WorkerResource { + // Optional. CPU request and limit for a single Airflow worker replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow worker replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow worker replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of workers for autoscaling. + int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of workers for autoscaling. + int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow triggerers. + message TriggererResource { + // Optional. The number of triggerers. + int32 count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CPU request and limit for a single Airflow triggerer replica. + float cpu = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow triggerer replica. + float memory_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Resources used by Airflow schedulers. + SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow web server. + WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow workers. + WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow triggerers. + TriggererResource triggerer = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Recovery settings of an environment. +message RecoveryConfig { + // Optional. The configuration for scheduled snapshot creation mechanism. + ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration for scheduled snapshot creation mechanism. +message ScheduledSnapshotsConfig { + // Optional. Whether scheduled snapshots creation is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage location for storing automatically created snapshots. + string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cron expression representing the time when snapshots creation mechanism + // runs. This field is subject to additional validation around frequency of + // execution. + string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +message MasterAuthorizedNetworksConfig { + // CIDR block with an optional name. + message CidrBlock { + // User-defined name that identifies the CIDR block. + string display_name = 1; + + // CIDR block that must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks feature is enabled. + bool enabled = 1; + + // Up to 50 external networks that could access Kubernetes master through + // HTTPS. + repeated CidrBlock cidr_blocks = 2; +} + +// Configuration for Cloud Data Lineage integration. +message CloudDataLineageIntegration { + // Optional. Whether or not Cloud Data Lineage integration is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// An environment for running orchestration tasks. +message Environment { + option (google.api.resource) = { + type: "composer.googleapis.com/Environment" + pattern: "projects/{project}/locations/{location}/environments/{environment}" + }; + + // State of the environment. + enum State { + // The state of the environment is unknown. + STATE_UNSPECIFIED = 0; + + // The environment is in the process of being created. + CREATING = 1; + + // The environment is currently running and healthy. It is ready for use. + RUNNING = 2; + + // The environment is being updated. It remains usable but cannot receive + // additional update requests or be deleted at this time. + UPDATING = 3; + + // The environment is undergoing deletion. It cannot be used. + DELETING = 4; + + // The environment has encountered an error and cannot be used. + ERROR = 5; + } + + // The resource name of the environment, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + // + // EnvironmentId must start with a lowercase letter followed by up to 63 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string name = 1; + + // Configuration parameters for this environment. + EnvironmentConfig config = 2; + + // Output only. The UUID (Universally Unique IDentifier) associated with this environment. + // This value is generated when the environment is created. + string uuid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The current state of the environment. + State state = 4; + + // Output only. The time at which this environment was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which this environment was last modified. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-defined labels for this environment. + // The labels map can contain no more than 64 entries. Entries of the labels + // map are UTF8 strings that comply with the following restrictions: + // + // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + // * Both keys and values are additionally constrained to be <= 128 bytes in + // size. + map labels = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request to check whether image upgrade will succeed. +message CheckUpgradeRequest { + // The resource name of the environment to check upgrade for, in the + // form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // The version of the software running in the environment. + // This encapsulates both the version of Cloud Composer functionality and the + // version of Apache Airflow. It must match the regular expression + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. + // When used as input, the server also checks if the provided version is + // supported and denies the request for an unsupported version. + // + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. + // + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. + // + // In all cases, the resolved image version is stored in the same field. + // + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). + string image_version = 2; +} + +// Message containing information about the result of an upgrade check +// operation. +message CheckUpgradeResponse { + // Whether there were python modules conflict during image build. + enum ConflictResult { + // It is unknown whether build had conflicts or not. + CONFLICT_RESULT_UNSPECIFIED = 0; + + // There were python packages conflicts. + CONFLICT = 1; + + // There were no python packages conflicts. + NO_CONFLICT = 2; + } + + // Output only. Url for a docker build log of an upgraded image. + string build_log_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether build has succeeded or failed on modules conflicts. + ConflictResult contains_pypi_modules_conflict = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extract from a docker image build log containing information about pypi + // modules conflicts. + string pypi_conflict_build_log_extract = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Composer image for which the build was happening. + string image_version = 5; + + // Pypi dependencies specified in the environment configuration, at the time + // when the build was triggered. + map pypi_dependencies = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto new file mode 100644 index 00000000000..08bc9f0f587 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto @@ -0,0 +1,88 @@ +// 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 +// +// 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.orchestration.airflow.service.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/type/date.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; +option java_multiple_files = true; +option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; + +// Readonly service to query available ImageVersions. +service ImageVersions { + option (google.api.default_host) = "composer.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // List ImageVersions for provided location. + rpc ListImageVersions(ListImageVersionsRequest) returns (ListImageVersionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/imageVersions" + }; + option (google.api.method_signature) = "parent"; + } +} + +// List ImageVersions in a project and location. +message ListImageVersionsRequest { + // List ImageVersions in the given project and location, in the form: + // "projects/{projectId}/locations/{locationId}" + string parent = 1; + + // The maximum number of image_versions to return. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, if any. + string page_token = 3; + + // Whether or not image versions from old releases should be included. + bool include_past_releases = 4; +} + +// The ImageVersions in a project and location. +message ListImageVersionsResponse { + // The list of supported ImageVersions in a location. + repeated ImageVersion image_versions = 1; + + // The page token used to query for the next page if one exists. + string next_page_token = 2; +} + +// Image Version information +message ImageVersion { + // The string identifier of the ImageVersion, in the form: + // "composer-x.y.z-airflow-a.b.c" + string image_version_id = 1; + + // Whether this is the default ImageVersion used by Composer during + // environment creation if no input ImageVersion is specified. + bool is_default = 2; + + // supported python versions + repeated string supported_python_versions = 3; + + // The date of the version release. + google.type.Date release_date = 4; + + // Whether it is impossible to create an environment with the image version. + bool creation_disabled = 5; + + // Whether it is impossible to upgrade an environment running with the image + // version. + bool upgrade_disabled = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto new file mode 100644 index 00000000000..5ba18a52299 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto @@ -0,0 +1,89 @@ +// 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 +// +// 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.orchestration.airflow.service.v1beta1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; +option java_multiple_files = true; +option java_outer_classname = "OperationsProto"; +option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; + +// Metadata describing an operation. +message OperationMetadata { + // An enum describing the overall state of an operation. + enum State { + // Unused. + STATE_UNSPECIFIED = 0; + + // The operation has been created but is not yet started. + PENDING = 1; + + // The operation is underway. + RUNNING = 2; + + // The operation completed successfully. + SUCCESSFUL = 3; + + // The operation is no longer running but did not succeed. + FAILED = 4; + } + + // Type of longrunning operation. + enum Type { + // Unused. + TYPE_UNSPECIFIED = 0; + + // A resource creation operation. + CREATE = 1; + + // A resource deletion operation. + DELETE = 2; + + // A resource update operation. + UPDATE = 3; + + // A resource check operation. + CHECK = 4; + + // Saves snapshot of the resource operation. + SAVE_SNAPSHOT = 5; + + // Loads snapshot of the resource operation. + LOAD_SNAPSHOT = 6; + } + + // Output only. The current operation state. + State state = 1; + + // Output only. The type of operation being performed. + Type operation_type = 2; + + // Output only. The resource being operated on, as a [relative resource name]( + // /apis/design/resource_names#relative_resource_name). + string resource = 3; + + // Output only. The UUID of the resource being operated on. + string resource_uuid = 4; + + // Output only. The time the operation was submitted to the server. + google.protobuf.Timestamp create_time = 5; + + // Output only. The time when the operation terminated, regardless of its success. + // This field is unset if the operation is still ongoing. + google.protobuf.Timestamp end_time = 6; +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js new file mode 100644 index 00000000000..53775ee99d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js @@ -0,0 +1,86 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_CheckUpgrade_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. + */ + /** + * The resource name of the environment to check upgrade for, in the + * form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * The version of the software running in the environment. + * This encapsulates both the version of Cloud Composer functionality and the + * version of Apache Airflow. It must match the regular expression + * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. + * When used as input, the server also checks if the provided version is + * supported and denies the request for an unsupported version. + * The Cloud Composer portion of the image version is a full + * semantic version (https://semver.org), or an alias in the form of major + * version number or `latest`. When an alias is provided, the server replaces + * it with the current Cloud Composer version that satisfies the alias. + * The Apache Airflow portion of the image version is a full semantic version + * that points to one of the supported Apache Airflow versions, or an alias in + * the form of only major or major.minor versions specified. When an alias is + * provided, the server replaces it with the latest Apache Airflow version + * that satisfies the alias and is supported in the given Cloud Composer + * version. + * In all cases, the resolved image version is stored in the same field. + * See also version + * list (/composer/docs/concepts/versioning/composer-versions) and versioning + * overview (/composer/docs/concepts/versioning/composer-versioning-overview). + */ + // const imageVersion = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callCheckUpgrade() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.checkUpgrade(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCheckUpgrade(); + // [END composer_v1beta1_generated_Environments_CheckUpgrade_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js new file mode 100644 index 00000000000..914230cd8da --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js @@ -0,0 +1,66 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_CreateEnvironment_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. + */ + /** + * The parent must be of the form + * "projects/{projectId}/locations/{locationId}". + */ + // const parent = 'abc123' + /** + * The environment to create. + */ + // const environment = {} + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callCreateEnvironment() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.createEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateEnvironment(); + // [END composer_v1beta1_generated_Environments_CreateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js new file mode 100644 index 00000000000..53a3ec8a1e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js @@ -0,0 +1,62 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_DeleteEnvironment_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. + */ + /** + * The environment to delete, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callDeleteEnvironment() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.deleteEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteEnvironment(); + // [END composer_v1beta1_generated_Environments_DeleteEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js new file mode 100644 index 00000000000..24507c3803b --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js @@ -0,0 +1,61 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_GetEnvironment_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. + */ + /** + * The resource name of the environment to get, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callGetEnvironment() { + // Construct request + const request = { + }; + + // Run request + const response = await serviceClient.getEnvironment(request); + console.log(response); + } + + callGetEnvironment(); + // [END composer_v1beta1_generated_Environments_GetEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js new file mode 100644 index 00000000000..cf9ae5d160f --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js @@ -0,0 +1,71 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_ListEnvironments_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. + */ + /** + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + */ + // const parent = 'abc123' + /** + * The maximum number of environments to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callListEnvironments() { + // Construct request + const request = { + }; + + // Run request + const iterable = await serviceClient.listEnvironmentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEnvironments(); + // [END composer_v1beta1_generated_Environments_ListEnvironments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js new file mode 100644 index 00000000000..7cdbce7bdf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js @@ -0,0 +1,87 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_LoadSnapshot_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. + */ + /** + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + */ + // const snapshotPath = 'abc123' + /** + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + */ + // const skipPypiPackagesInstallation = true + /** + * Whether or not to skip setting environment variables when loading the + * environment's state. + */ + // const skipEnvironmentVariablesSetting = true + /** + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + */ + // const skipAirflowOverridesSetting = true + /** + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + */ + // const skipGcsDataCopying = true + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callLoadSnapshot() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.loadSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callLoadSnapshot(); + // [END composer_v1beta1_generated_Environments_LoadSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js new file mode 100644 index 00000000000..dc26ccf4c01 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js @@ -0,0 +1,63 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_RestartWebServer_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. + */ + /** + * The resource name of the environment to restart the web server for, in the + * form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callRestartWebServer() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.restartWebServer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestartWebServer(); + // [END composer_v1beta1_generated_Environments_RestartWebServer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js new file mode 100644 index 00000000000..f5d7b3e0f43 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js @@ -0,0 +1,67 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_Environments_SaveSnapshot_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. + */ + /** + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const environment = 'abc123' + /** + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + */ + // const snapshotLocation = 'abc123' + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callSaveSnapshot() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await serviceClient.saveSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSaveSnapshot(); + // [END composer_v1beta1_generated_Environments_SaveSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js new file mode 100644 index 00000000000..9ce9ee97029 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js @@ -0,0 +1,206 @@ +// 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 +// +// 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'; + +function main(updateMask) { + // [START composer_v1beta1_generated_Environments_UpdateEnvironment_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. + */ + /** + * The relative resource name of the environment to update, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + */ + // const name = 'abc123' + /** + * A patch environment. Fields specified by the `updateMask` will be copied + * from the patch environment into the environment under update. + */ + // const environment = {} + /** + * Required. A comma-separated list of paths, relative to `Environment`, of + * fields to update. + * For example, to set the version of scikit-learn to install in the + * environment to 0.19.0 and to remove an existing installation of + * argparse, the `updateMask` parameter would include the following two + * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * "config.softwareConfig.pypiPackages.argparse". The included patch + * environment would specify the scikit-learn version as follows: + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "scikit-learn":"==0.19.0" + * } + * } + * } + * } + * Note that in the above example, any existing PyPI packages + * other than scikit-learn and argparse will be unaffected. + * Only one update type may be included in a single request's `updateMask`. + * For example, one cannot update both the PyPI packages and + * labels in the same request. However, it is possible to update multiple + * members of a map field simultaneously in the same request. For example, + * to set the labels "label1" and "label2" while clearing "label3" (assuming + * it already exists), one can + * provide the paths "labels.label1", "labels.label2", and "labels.label3" + * and populate the patch environment as follows: + * { + * "labels":{ + * "label1":"new-label1-value" + * "label2":"new-label2-value" + * } + * } + * Note that in the above example, any existing labels that are not + * included in the `updateMask` will be unaffected. + * It is also possible to replace an entire map field by providing the + * map field's path in the `updateMask`. The new value of the field will + * be that which is provided in the patch environment. For example, to + * delete all pre-existing user-specified PyPI packages and + * install botocore at version 1.7.14, the `updateMask` would contain + * the path "config.softwareConfig.pypiPackages", and + * the patch environment would be the following: + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "botocore":"==1.7.14" + * } + * } + * } + * } + * **Note:** Only the following fields can be updated: + * * `config.softwareConfig.pypiPackages` + * * Replace all custom custom PyPI packages. If a replacement + * package map is not included in `environment`, all custom + * PyPI packages are cleared. It is an error to provide both + * this mask and a mask specifying an individual package. + * * `config.softwareConfig.pypiPackages.`packagename + * * Update the custom PyPI package *packagename*, + * preserving other packages. To delete the package, include it in + * `updateMask`, and omit the mapping for it in + * `environment.config.softwareConfig.pypiPackages`. It is an error + * to provide both a mask of this form and the + * `config.softwareConfig.pypiPackages` mask. + * * `labels` + * * Replace all environment labels. If a replacement labels map is not + * included in `environment`, all labels are cleared. It is an error to + * provide both this mask and a mask specifying one or more individual + * labels. + * * `labels.`labelName + * * Set the label named *labelName*, while preserving other + * labels. To delete the label, include it in `updateMask` and omit its + * mapping in `environment.labels`. It is an error to provide both a + * mask of this form and the `labels` mask. + * * `config.nodeCount` + * * Horizontally scale the number of nodes in the environment. An integer + * greater than or equal to 3 must be provided in the `config.nodeCount` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` + * * Replace the environment's current WebServerNetworkAccessControl. + * * `config.softwareConfig.airflowConfigOverrides` + * * Replace all Apache Airflow config overrides. If a replacement config + * overrides map is not included in `environment`, all config overrides + * are cleared. + * It is an error to provide both this mask and a mask specifying one or + * more individual config overrides. + * * `config.softwareConfig.airflowConfigOverrides.`section-name + * * Override the Apache Airflow config property *name* in the + * section named *section*, preserving other properties. To + * delete the property override, include it in `updateMask` and omit its + * mapping in + * `environment.config.softwareConfig.airflowConfigOverrides`. + * It is an error to provide both a mask of this form and the + * `config.softwareConfig.airflowConfigOverrides` mask. + * * `config.softwareConfig.envVariables` + * * Replace all environment variables. If a replacement environment + * variable map is not included in `environment`, all custom environment + * variables are cleared. + * * `config.softwareConfig.imageVersion` + * * Upgrade the version of the environment in-place. Refer to + * `SoftwareConfig.image_version` for information on how to format the + * new image version. Additionally, the new image version cannot effect + * a version downgrade, and must match the current image version's + * Composer and Airflow major versions. Consult the Cloud Composer + * version list (/composer/docs/concepts/versioning/composer-versions) + * for valid values. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.softwareConfig.cloudDataLineageIntegration` + * * Configuration for Cloud Data Lineage integration. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + * * `config.maintenanceWindow` + * * Maintenance window during which Cloud Composer components may be + * under maintenance. + * * `config.workloadsConfig` + * * The workloads configuration settings for the GKE cluster associated + * with the Cloud Composer environment. Supported for Cloud Composer + * environments in versions composer-2.*.*-airflow-*.*.* and newer. + * * `config.environmentSize` + * * The size of the Cloud Composer environment. Supported for Cloud + * Composer environments in versions composer-2.*.*-airflow-*.*.* and + * newer. + */ + // const updateMask = {} + + // Imports the Service library + const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new EnvironmentsClient(); + + async function callUpdateEnvironment() { + // Construct request + const request = { + updateMask, + }; + + // Run request + const [operation] = await serviceClient.updateEnvironment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateEnvironment(); + // [END composer_v1beta1_generated_Environments_UpdateEnvironment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js new file mode 100644 index 00000000000..ca3b5cb3208 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js @@ -0,0 +1,75 @@ +// 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 +// +// 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'; + +function main() { + // [START composer_v1beta1_generated_ImageVersions_ListImageVersions_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. + */ + /** + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + */ + // const parent = 'abc123' + /** + * The maximum number of image_versions to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * Whether or not image versions from old releases should be included. + */ + // const includePastReleases = true + + // Imports the Service library + const {ImageVersionsClient} = require('@google-cloud/orchestration-airflow').v1beta1; + + // Instantiates a client + const serviceClient = new ImageVersionsClient(); + + async function callListImageVersions() { + // Construct request + const request = { + }; + + // Run request + const iterable = await serviceClient.listImageVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListImageVersions(); + // [END composer_v1beta1_generated_ImageVersions_ListImageVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json new file mode 100644 index 00000000000..590058c1a97 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json @@ -0,0 +1,475 @@ +{ + "clientLibrary": { + "name": "nodejs-service", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.orchestration.airflow.service.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "composer_v1beta1_generated_Environments_CreateEnvironment_async", + "title": "Environments createEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Create a new environment.", + "canonical": true, + "file": "environments.create_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "environment", + "type": ".google.cloud.orchestration.airflow.service.v1beta1.Environment" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "CreateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_GetEnvironment_async", + "title": "Environments getEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Get an existing environment.", + "canonical": true, + "file": "environments.get_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.Environment", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "GetEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_ListEnvironments_async", + "title": "Environments listEnvironments Sample", + "origin": "API_DEFINITION", + "description": " List environments.", + "canonical": true, + "file": "environments.list_environments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "ListEnvironments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironments", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_UpdateEnvironment_async", + "title": "Environments updateEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Update an environment.", + "canonical": true, + "file": "environments.update_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 198, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "environment", + "type": ".google.cloud.orchestration.airflow.service.v1beta1.Environment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "UpdateEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_DeleteEnvironment_async", + "title": "Environments deleteEnvironment Sample", + "origin": "API_DEFINITION", + "description": " Delete an environment.", + "canonical": true, + "file": "environments.delete_environment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "DeleteEnvironment", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironment", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_RestartWebServer_async", + "title": "Environments restartWebServer Sample", + "origin": "API_DEFINITION", + "description": " Restart Airflow web server.", + "canonical": true, + "file": "environments.restart_web_server.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartWebServer", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "RestartWebServer", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServer", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_CheckUpgrade_async", + "title": "Environments checkUpgrade Sample", + "origin": "API_DEFINITION", + "description": " Check if an upgrade operation on the environment will succeed. In case of problems detailed info can be found in the returned Operation.", + "canonical": true, + "file": "environments.check_upgrade.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CheckUpgrade", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgrade", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "image_version", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "CheckUpgrade", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgrade", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_SaveSnapshot_async", + "title": "Environments saveSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", + "canonical": true, + "file": "environments.save_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_LoadSnapshot_async", + "title": "Environments loadSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", + "canonical": true, + "file": "environments.load_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_path", + "type": "TYPE_STRING" + }, + { + "name": "skip_pypi_packages_installation", + "type": "TYPE_BOOL" + }, + { + "name": "skip_environment_variables_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_airflow_overrides_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_gcs_data_copying", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_ImageVersions_ListImageVersions_async", + "title": "Environments listImageVersions Sample", + "origin": "API_DEFINITION", + "description": " List ImageVersions for provided location.", + "canonical": true, + "file": "image_versions.list_image_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions.ListImageVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "include_past_releases", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsResponse", + "client": { + "shortName": "ImageVersionsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersionsClient" + }, + "method": { + "shortName": "ListImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions.ListImageVersions", + "service": { + "shortName": "ImageVersions", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts new file mode 100644 index 00000000000..6e03957497c --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts @@ -0,0 +1,27 @@ +// 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 +// +// 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 v1beta1 from './v1beta1'; +const EnvironmentsClient = v1beta1.EnvironmentsClient; +type EnvironmentsClient = v1beta1.EnvironmentsClient; +const ImageVersionsClient = v1beta1.ImageVersionsClient; +type ImageVersionsClient = v1beta1.ImageVersionsClient; +export {v1beta1, EnvironmentsClient, ImageVersionsClient}; +export default {v1beta1, EnvironmentsClient, ImageVersionsClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts new file mode 100644 index 00000000000..f60a5c33efe --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts @@ -0,0 +1,1723 @@ +// 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 +// +// 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/environments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './environments_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Managed Apache Airflow Environments. + * @class + * @memberof v1beta1 + */ +export class EnvironmentsClient { + 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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + environmentsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of EnvironmentsClient. + * + * @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/main/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] + * @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 {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @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}. + * @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 EnvironmentsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof EnvironmentsClient; + 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 = 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. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + 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 ? gaxInstance.fallback : gaxInstance; + + // 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. + this._opts = opts; + + // 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; + } + + // Determine the client header string. + 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/${this._gaxModule.version}`); + } + 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}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/environments/{environment}' + ), + }; + + // 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 = { + listEnvironments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'environments') + }; + + 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.longrunning.Operations.DeleteOperation',delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; + const createEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const updateEnvironmentResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; + const updateEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const deleteEnvironmentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteEnvironmentMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const restartWebServerResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; + const restartWebServerMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const checkUpgradeResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse') as gax.protobuf.Type; + const checkUpgradeMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const saveSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse') as gax.protobuf.Type; + const saveSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + const loadSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse') as gax.protobuf.Type; + const loadSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createEnvironmentResponse.decode.bind(createEnvironmentResponse), + createEnvironmentMetadata.decode.bind(createEnvironmentMetadata)), + updateEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), + updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata)), + deleteEnvironment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), + deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata)), + restartWebServer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartWebServerResponse.decode.bind(restartWebServerResponse), + restartWebServerMetadata.decode.bind(restartWebServerMetadata)), + checkUpgrade: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + checkUpgradeResponse.decode.bind(checkUpgradeResponse), + checkUpgradeMetadata.decode.bind(checkUpgradeMetadata)), + saveSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + saveSnapshotResponse.decode.bind(saveSnapshotResponse), + saveSnapshotMetadata.decode.bind(saveSnapshotMetadata)), + loadSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadSnapshotResponse.decode.bind(loadSnapshotResponse), + loadSnapshotMetadata.decode.bind(loadSnapshotMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.orchestration.airflow.service.v1beta1.Environments', 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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.environmentsStub) { + return this.environmentsStub; + } + + // Put together the "service stub" for + // google.cloud.orchestration.airflow.service.v1beta1.Environments. + this.environmentsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1beta1.Environments') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.orchestration.airflow.service.v1beta1.Environments, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const environmentsStubMethods = + ['createEnvironment', 'getEnvironment', 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', 'restartWebServer', 'checkUpgrade', 'saveSnapshot', 'loadSnapshot']; + for (const methodName of environmentsStubMethods) { + const callPromise = this.environmentsStub.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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.environmentsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'composer.googleapis.com'; + } + + /** + * 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 'composer.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Get an existing environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource name of the environment to get, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. + * 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/v1beta1/environments.get_environment.js + * region_tag:composer_v1beta1_generated_Environments_GetEnvironment_async + */ + getEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|undefined, {}|undefined + ]>; + getEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): void; + getEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, + callback: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): void; + getEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, + protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getEnvironment(request, options, callback); + } + +/** + * Create a new environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent must be of the form + * "projects/{projectId}/locations/{locationId}". + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} request.environment + * The environment 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/v1beta1/environments.create_environment.js + * region_tag:composer_v1beta1_generated_Environments_CreateEnvironment_async + */ + createEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createEnvironment()`. + * @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 include:samples/generated/v1beta1/environments.create_environment.js + * region_tag:composer_v1beta1_generated_Environments_CreateEnvironment_async + */ + async checkCreateEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update an environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The relative resource name of the environment to update, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} request.environment + * A patch environment. Fields specified by the `updateMask` will be copied + * from the patch environment into the environment under update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. A comma-separated list of paths, relative to `Environment`, of + * fields to update. + * For example, to set the version of scikit-learn to install in the + * environment to 0.19.0 and to remove an existing installation of + * argparse, the `updateMask` parameter would include the following two + * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and + * "config.softwareConfig.pypiPackages.argparse". The included patch + * environment would specify the scikit-learn version as follows: + * + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "scikit-learn":"==0.19.0" + * } + * } + * } + * } + * + * Note that in the above example, any existing PyPI packages + * other than scikit-learn and argparse will be unaffected. + * + * Only one update type may be included in a single request's `updateMask`. + * For example, one cannot update both the PyPI packages and + * labels in the same request. However, it is possible to update multiple + * members of a map field simultaneously in the same request. For example, + * to set the labels "label1" and "label2" while clearing "label3" (assuming + * it already exists), one can + * provide the paths "labels.label1", "labels.label2", and "labels.label3" + * and populate the patch environment as follows: + * + * { + * "labels":{ + * "label1":"new-label1-value" + * "label2":"new-label2-value" + * } + * } + * + * Note that in the above example, any existing labels that are not + * included in the `updateMask` will be unaffected. + * + * It is also possible to replace an entire map field by providing the + * map field's path in the `updateMask`. The new value of the field will + * be that which is provided in the patch environment. For example, to + * delete all pre-existing user-specified PyPI packages and + * install botocore at version 1.7.14, the `updateMask` would contain + * the path "config.softwareConfig.pypiPackages", and + * the patch environment would be the following: + * + * { + * "config":{ + * "softwareConfig":{ + * "pypiPackages":{ + * "botocore":"==1.7.14" + * } + * } + * } + * } + * + * **Note:** Only the following fields can be updated: + * + * * `config.softwareConfig.pypiPackages` + * * Replace all custom custom PyPI packages. If a replacement + * package map is not included in `environment`, all custom + * PyPI packages are cleared. It is an error to provide both + * this mask and a mask specifying an individual package. + * * `config.softwareConfig.pypiPackages.`packagename + * * Update the custom PyPI package *packagename*, + * preserving other packages. To delete the package, include it in + * `updateMask`, and omit the mapping for it in + * `environment.config.softwareConfig.pypiPackages`. It is an error + * to provide both a mask of this form and the + * `config.softwareConfig.pypiPackages` mask. + * * `labels` + * * Replace all environment labels. If a replacement labels map is not + * included in `environment`, all labels are cleared. It is an error to + * provide both this mask and a mask specifying one or more individual + * labels. + * * `labels.`labelName + * * Set the label named *labelName*, while preserving other + * labels. To delete the label, include it in `updateMask` and omit its + * mapping in `environment.labels`. It is an error to provide both a + * mask of this form and the `labels` mask. + * * `config.nodeCount` + * * Horizontally scale the number of nodes in the environment. An integer + * greater than or equal to 3 must be provided in the `config.nodeCount` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` + * * Replace the environment's current WebServerNetworkAccessControl. + * * `config.softwareConfig.airflowConfigOverrides` + * * Replace all Apache Airflow config overrides. If a replacement config + * overrides map is not included in `environment`, all config overrides + * are cleared. + * It is an error to provide both this mask and a mask specifying one or + * more individual config overrides. + * * `config.softwareConfig.airflowConfigOverrides.`section-name + * * Override the Apache Airflow config property *name* in the + * section named *section*, preserving other properties. To + * delete the property override, include it in `updateMask` and omit its + * mapping in + * `environment.config.softwareConfig.airflowConfigOverrides`. + * It is an error to provide both a mask of this form and the + * `config.softwareConfig.airflowConfigOverrides` mask. + * * `config.softwareConfig.envVariables` + * * Replace all environment variables. If a replacement environment + * variable map is not included in `environment`, all custom environment + * variables are cleared. + * * `config.softwareConfig.imageVersion` + * * Upgrade the version of the environment in-place. Refer to + * `SoftwareConfig.image_version` for information on how to format the + * new image version. Additionally, the new image version cannot effect + * a version downgrade, and must match the current image version's + * Composer and Airflow major versions. Consult the [Cloud Composer + * version list](/composer/docs/concepts/versioning/composer-versions) + * for valid values. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.softwareConfig.cloudDataLineageIntegration` + * * Configuration for Cloud Data Lineage integration. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + * * `config.maintenanceWindow` + * * Maintenance window during which Cloud Composer components may be + * under maintenance. + * * `config.workloadsConfig` + * * The workloads configuration settings for the GKE cluster associated + * with the Cloud Composer environment. Supported for Cloud Composer + * environments in versions composer-2.*.*-airflow-*.*.* and newer. + * * `config.environmentSize` + * * The size of the Cloud Composer environment. Supported for Cloud + * Composer environments in versions composer-2.*.*-airflow-*.*.* and + * newer. + * @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/v1beta1/environments.update_environment.js + * region_tag:composer_v1beta1_generated_Environments_UpdateEnvironment_async + */ + updateEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateEnvironment()`. + * @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 include:samples/generated/v1beta1/environments.update_environment.js + * region_tag:composer_v1beta1_generated_Environments_UpdateEnvironment_async + */ + async checkUpdateEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Delete an environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The environment to delete, in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @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/v1beta1/environments.delete_environment.js + * region_tag:composer_v1beta1_generated_Environments_DeleteEnvironment_async + */ + deleteEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEnvironment( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteEnvironment( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteEnvironment(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteEnvironment()`. + * @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 include:samples/generated/v1beta1/environments.delete_environment.js + * region_tag:composer_v1beta1_generated_Environments_DeleteEnvironment_async + */ + async checkDeleteEnvironmentProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEnvironment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restart Airflow web server. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource name of the environment to restart the web server for, in the + * form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @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/v1beta1/environments.restart_web_server.js + * region_tag:composer_v1beta1_generated_Environments_RestartWebServer_async + */ + restartWebServer( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartWebServer( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartWebServer( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartWebServer( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.restartWebServer(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartWebServer()`. + * @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 include:samples/generated/v1beta1/environments.restart_web_server.js + * region_tag:composer_v1beta1_generated_Environments_RestartWebServer_async + */ + async checkRestartWebServerProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartWebServer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Check if an upgrade operation on the environment will succeed. + * + * In case of problems detailed info can be found in the returned Operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the environment to check upgrade for, in the + * form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.imageVersion + * The version of the software running in the environment. + * This encapsulates both the version of Cloud Composer functionality and the + * version of Apache Airflow. It must match the regular expression + * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. + * When used as input, the server also checks if the provided version is + * supported and denies the request for an unsupported version. + * + * The Cloud Composer portion of the image version is a full + * [semantic version](https://semver.org), or an alias in the form of major + * version number or `latest`. When an alias is provided, the server replaces + * it with the current Cloud Composer version that satisfies the alias. + * + * The Apache Airflow portion of the image version is a full semantic version + * that points to one of the supported Apache Airflow versions, or an alias in + * the form of only major or major.minor versions specified. When an alias is + * provided, the server replaces it with the latest Apache Airflow version + * that satisfies the alias and is supported in the given Cloud Composer + * version. + * + * In all cases, the resolved image version is stored in the same field. + * + * See also [version + * list](/composer/docs/concepts/versioning/composer-versions) and [versioning + * overview](/composer/docs/concepts/versioning/composer-versioning-overview). + * @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/v1beta1/environments.check_upgrade.js + * region_tag:composer_v1beta1_generated_Environments_CheckUpgrade_async + */ + checkUpgrade( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + checkUpgrade( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkUpgrade( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + checkUpgrade( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'environment': request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.checkUpgrade(request, options, callback); + } +/** + * Check the status of the long running operation returned by `checkUpgrade()`. + * @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 include:samples/generated/v1beta1/environments.check_upgrade.js + * region_tag:composer_v1beta1_generated_Environments_CheckUpgrade_async + */ + async checkCheckUpgradeProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkUpgrade, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a snapshots of a Cloud Composer environment. + * + * As a result of this operation, snapshot of environment's state is stored + * in a location specified in the SaveSnapshotRequest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotLocation + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + * @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/v1beta1/environments.save_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async + */ + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'environment': request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.saveSnapshot(request, options, callback); + } +/** + * Check the status of the long running operation returned by `saveSnapshot()`. + * @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 include:samples/generated/v1beta1/environments.save_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async + */ + async checkSaveSnapshotProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.saveSnapshot, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Loads a snapshot of a Cloud Composer environment. + * + * As a result of this operation, a snapshot of environment's specified in + * LoadSnapshotRequest is loaded into the environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotPath + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + * @param {boolean} request.skipPypiPackagesInstallation + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + * @param {boolean} request.skipEnvironmentVariablesSetting + * Whether or not to skip setting environment variables when loading the + * environment's state. + * @param {boolean} request.skipAirflowOverridesSetting + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + * @param {boolean} request.skipGcsDataCopying + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + * @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/v1beta1/environments.load_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async + */ + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + optionsOrCallback?: 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: 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'environment': request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.loadSnapshot(request, options, callback); + } +/** + * Check the status of the long running operation returned by `loadSnapshot()`. + * @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 include:samples/generated/v1beta1/environments.load_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async + */ + async checkLoadSnapshotProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.loadSnapshot, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List environments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. + * 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. + * Note that it can affect your quota. + * We recommend using `listEnvironmentsAsync()` + * 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. + */ + listEnvironments( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[], + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse + ]>; + listEnvironments( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): void; + listEnvironments( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): void; + listEnvironments( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>, + callback?: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[], + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listEnvironments(request, options, callback); + } + +/** + * 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 + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment} 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 `listEnvironmentsAsync()` + * 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. + */ + listEnvironmentsStream( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.createStream( + this.innerApiCalls.listEnvironments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEnvironments`, 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 + * List environments in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of environments to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @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). + * When you iterate the returned iterable, each element will be an object representing + * [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. 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 include:samples/generated/v1beta1/environments.list_environments.js + * region_tag:composer_v1beta1_generated_Environments_ListEnvironments_async + */ + listEnvironmentsAsync( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listEnvironments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listEnvironments.asyncIterate( + this.innerApiCalls['listEnvironments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {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 {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project:string,location:string,environment:string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).location; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; + } + + /** + * 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 { + if (this.environmentsStub && !this._terminated) { + return this.environmentsStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json new file mode 100644 index 00000000000..f31d666bb58 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.orchestration.airflow.service.v1beta1.Environments": { + "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": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEnvironments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEnvironment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartWebServer": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CheckUpgrade": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SaveSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LoadSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json new file mode 100644 index 00000000000..c854c306722 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto" +] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..7dfe380be56 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,145 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.orchestration.airflow.service.v1beta1", + "libraryPackage": "@google-cloud/orchestration-airflow", + "services": { + "Environments": { + "clients": { + "grpc": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "RestartWebServer": { + "methods": [ + "restartWebServer" + ] + }, + "CheckUpgrade": { + "methods": [ + "checkUpgrade" + ] + }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "EnvironmentsClient", + "rpcs": { + "GetEnvironment": { + "methods": [ + "getEnvironment" + ] + }, + "CreateEnvironment": { + "methods": [ + "createEnvironment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "updateEnvironment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "deleteEnvironment" + ] + }, + "RestartWebServer": { + "methods": [ + "restartWebServer" + ] + }, + "CheckUpgrade": { + "methods": [ + "checkUpgrade" + ] + }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, + "ListEnvironments": { + "methods": [ + "listEnvironments", + "listEnvironmentsStream", + "listEnvironmentsAsync" + ] + } + } + } + } + }, + "ImageVersions": { + "clients": { + "grpc": { + "libraryClient": "ImageVersionsClient", + "rpcs": { + "ListImageVersions": { + "methods": [ + "listImageVersions", + "listImageVersionsStream", + "listImageVersionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ImageVersionsClient", + "rpcs": { + "ListImageVersions": { + "methods": [ + "listImageVersions", + "listImageVersionsStream", + "listImageVersionsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts new file mode 100644 index 00000000000..3884db4d148 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts @@ -0,0 +1,557 @@ +// 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 +// +// 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/image_versions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './image_versions_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Readonly service to query available ImageVersions. + * @class + * @memberof v1beta1 + */ +export class ImageVersionsClient { + 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: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + imageVersionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ImageVersionsClient. + * + * @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/main/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] + * @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 {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @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}. + * @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 ImageVersionsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ImageVersionsClient; + 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 = 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. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + 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 ? gaxInstance.fallback : gaxInstance; + + // 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. + this._opts = opts; + + // 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; + } + + // Determine the client header string. + 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/${this._gaxModule.version}`); + } + 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}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/environments/{environment}' + ), + }; + + // 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 = { + listImageVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'imageVersions') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.orchestration.airflow.service.v1beta1.ImageVersions', 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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.imageVersionsStub) { + return this.imageVersionsStub; + } + + // Put together the "service stub" for + // google.cloud.orchestration.airflow.service.v1beta1.ImageVersions. + this.imageVersionsStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1beta1.ImageVersions') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.orchestration.airflow.service.v1beta1.ImageVersions, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const imageVersionsStubMethods = + ['listImageVersions']; + for (const methodName of imageVersionsStubMethods) { + const callPromise = this.imageVersionsStub.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); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.imageVersionsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'composer.googleapis.com'; + } + + /** + * 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 'composer.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * List ImageVersions for provided location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion}. + * 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. + * Note that it can affect your quota. + * We recommend using `listImageVersionsAsync()` + * 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. + */ + listImageVersions( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[], + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse + ]>; + listImageVersions( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): void; + listImageVersions( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): void; + listImageVersions( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>, + callback?: PaginationCallback< + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): + Promise<[ + protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[], + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest|null, + protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse + ]>|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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listImageVersions(request, options, callback); + } + +/** + * 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 + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion} 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 `listImageVersionsAsync()` + * 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. + */ + listImageVersionsStream( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listImageVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listImageVersions.createStream( + this.innerApiCalls.listImageVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listImageVersions`, 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 + * List ImageVersions in the given project and location, in the form: + * "projects/{projectId}/locations/{locationId}" + * @param {number} request.pageSize + * The maximum number of image_versions to return. + * @param {string} request.pageToken + * The next_page_token value returned from a previous List request, if any. + * @param {boolean} request.includePastReleases + * Whether or not image versions from old releases should be included. + * @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). + * When you iterate the returned iterable, each element will be an object representing + * [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion}. 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 include:samples/generated/v1beta1/image_versions.list_image_versions.js + * region_tag:composer_v1beta1_generated_ImageVersions_ListImageVersions_async + */ + listImageVersionsAsync( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listImageVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listImageVersions.asyncIterate( + this.innerApiCalls['listImageVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project:string,location:string,environment:string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + location: location, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).project; + } + + /** + * Parse the location from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).location; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; + } + + /** + * 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 { + if (this.imageVersionsStub && !this._terminated) { + return this.imageVersionsStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json new file mode 100644 index 00000000000..9db3275858a --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions": { + "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": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListImageVersions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json new file mode 100644 index 00000000000..c854c306722 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto", + "../../protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto" +] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000000..9a109a1d699 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,20 @@ +// 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 +// +// 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 {EnvironmentsClient} from './environments_client'; +export {ImageVersionsClient} from './image_versions_client'; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3d4b3363bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// 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 +// +// 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 service = require('@google-cloud/orchestration-airflow'); + +function main() { + const environmentsClient = new service.EnvironmentsClient(); + const imageVersionsClient = new service.ImageVersionsClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..63551cdc1e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// 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 +// +// 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 {EnvironmentsClient, ImageVersionsClient} from '@google-cloud/orchestration-airflow'; + +// check that the client class type name can be used +function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { + client.close(); +} +function doStuffWithImageVersionsClient(client: ImageVersionsClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const environmentsClient = new EnvironmentsClient(); + doStuffWithEnvironmentsClient(environmentsClient); + // check that the client instance can be created + const imageVersionsClient = new ImageVersionsClient(); + doStuffWithImageVersionsClient(imageVersionsClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts new file mode 100644 index 00000000000..557a57558e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// 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 +// +// 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'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts new file mode 100644 index 00000000000..4cbf306b3b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts @@ -0,0 +1,1948 @@ +// 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 +// +// 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 environmentsModule from '../src'; + +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) + .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('v1beta1.EnvironmentsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = environmentsModule.v1beta1.EnvironmentsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = environmentsModule.v1beta1.EnvironmentsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = environmentsModule.v1beta1.EnvironmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + await client.initialize(); + assert(client.environmentsStub); + }); + + it('has close method for the initialized client', done => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.environmentsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.environmentsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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 environmentsModule.v1beta1.EnvironmentsClient({ + 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('getEnvironment', () => { + it('invokes getEnvironment without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); + const [response] = await client.getEnvironment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment() + ); + client.innerApiCalls.getEnvironment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEnvironment( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEnvironment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEnvironment with closed client', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getEnvironment(request), expectedError); + }); + }); + + describe('createEnvironment', () => { + it('invokes createEnvironment without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.createEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createEnvironment( + 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); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createEnvironment with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkCreateEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkCreateEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateEnvironment', () => { + it('invokes updateEnvironment without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateEnvironment( + 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); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateEnvironment with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkUpdateEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkUpdateEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteEnvironment', () => { + it('invokes deleteEnvironment without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteEnvironment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteEnvironment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteEnvironment( + 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); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEnvironment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteEnvironment with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEnvironment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteEnvironmentProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkDeleteEnvironmentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteEnvironmentProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkDeleteEnvironmentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartWebServer', () => { + it('invokes restartWebServer without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartWebServer = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartWebServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartWebServer without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartWebServer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartWebServer( + 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); + const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartWebServer with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartWebServer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartWebServer(request), expectedError); + const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restartWebServer with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restartWebServer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartWebServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestartWebServerProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkRestartWebServerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartWebServerProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkRestartWebServerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('checkUpgrade', () => { + it('invokes checkUpgrade without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.checkUpgrade = stubLongRunningCall(expectedResponse); + const [operation] = await client.checkUpgrade(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgrade without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.checkUpgrade = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.checkUpgrade( + 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); + const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgrade with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkUpgrade = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.checkUpgrade(request), expectedError); + const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpgrade with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkUpgrade = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.checkUpgrade(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCheckUpgradeProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkCheckUpgradeProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCheckUpgradeProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkCheckUpgradeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('saveSnapshot', () => { + it('invokes saveSnapshot without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.saveSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.saveSnapshot( + 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); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.saveSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.saveSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSaveSnapshotProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSaveSnapshotProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('loadSnapshot', () => { + it('invokes loadSnapshot without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadSnapshot( + 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); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.loadSnapshot(request), expectedError); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.loadSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadSnapshotProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadSnapshotProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listEnvironments', () => { + it('invokes listEnvironments without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); + const [response] = await client.listEnvironments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + ]; + client.innerApiCalls.listEnvironments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEnvironments( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironments with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEnvironments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEnvironments(request), expectedError); + const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEnvironmentsStream without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + ]; + client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment) => { + 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.listEnvironments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEnvironmentsStream with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEnvironmentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); + assert( + (client.descriptors.page.listEnvironments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), + ]; + client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[] = []; + const iterable = client.listEnvironmentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEnvironments with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEnvironmentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('environment', () => { + const fakePath = "/rendered/path/environment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + environment: "environmentValue", + }; + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, "environmentValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts new file mode 100644 index 00000000000..4ab16296728 --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts @@ -0,0 +1,491 @@ +// 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 +// +// 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 imageversionsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} 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) + .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 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('v1beta1.ImageVersionsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = imageversionsModule.v1beta1.ImageVersionsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = imageversionsModule.v1beta1.ImageVersionsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = imageversionsModule.v1beta1.ImageVersionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.imageVersionsStub, undefined); + await client.initialize(); + assert(client.imageVersionsStub); + }); + + it('has close method for the initialized client', done => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.imageVersionsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.imageVersionsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + 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 imageversionsModule.v1beta1.ImageVersionsClient({ + 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('listImageVersions', () => { + it('invokes listImageVersions without error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + ]; + client.innerApiCalls.listImageVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listImageVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersions without error using callback', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + ]; + client.innerApiCalls.listImageVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listImageVersions( + request, + (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersions with error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listImageVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listImageVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listImageVersionsStream without error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + ]; + client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listImageVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion) => { + 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.listImageVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); + assert( + (client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listImageVersionsStream with error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listImageVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion[] = []; + stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); + assert( + (client.descriptors.page.listImageVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listImageVersions without error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), + ]; + client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[] = []; + const iterable = client.listImageVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listImageVersions with error', async () => { + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listImageVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('environment', () => { + const fakePath = "/rendered/path/environment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + environment: "environmentValue", + }; + const client = new imageversionsModule.v1beta1.ImageVersionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEnvironmentName', () => { + const result = client.matchLocationFromEnvironmentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, "environmentValue"); + assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js new file mode 100644 index 00000000000..9b7becac60a --- /dev/null +++ b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// 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 +// +// 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. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Environments', + filename: './environments.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + 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/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From c582b6a3f2621f6f0367fd6adabb54768cb61e44 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 1 Dec 2022 18:18:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-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 --- .../v1/.eslintignore | 7 - .../v1/.eslintrc.json | 3 - .../v1/.gitignore | 14 - .../v1/.jsdoc.js | 55 - .../v1/.mocharc.js | 33 - .../v1/.prettierrc.js | 22 - .../v1/README.md | 1 - .../v1/linkinator.config.json | 16 - .../v1/package.json | 65 - .../airflow/service/v1/environments.proto | 1129 - .../airflow/service/v1/image_versions.proto | 88 - .../airflow/service/v1/operations.proto | 93 - .../v1/environments.create_environment.js | 66 - .../v1/environments.delete_environment.js | 62 - .../v1/environments.get_environment.js | 61 - .../v1/environments.list_environments.js | 71 - .../v1/environments.update_environment.js | 184 - .../v1/image_versions.list_image_versions.js | 75 - ...loud.orchestration.airflow.service.v1.json | 391 - .../v1/src/index.ts | 27 - .../v1/src/v1/environments_client.ts | 1473 - .../v1/src/v1/environments_client_config.json | 54 - .../v1/src/v1/environments_proto_list.json | 5 - .../v1/src/v1/gapic_metadata.json | 125 - .../v1/src/v1/image_versions_client.ts | 557 - .../src/v1/image_versions_client_config.json | 30 - .../v1/src/v1/image_versions_proto_list.json | 5 - .../v1/src/v1/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_environments_v1.ts | 1640 -- .../v1/test/gapic_image_versions_v1.ts | 491 - .../v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - .../v1beta1/.eslintignore | 7 - .../v1beta1/.eslintrc.json | 3 - .../v1beta1/.gitignore | 14 - .../v1beta1/.jsdoc.js | 55 - .../v1beta1/.mocharc.js | 33 - .../v1beta1/.prettierrc.js | 22 - .../v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - .../v1beta1/package.json | 65 - .../service/v1beta1/environments.proto | 1305 - .../service/v1beta1/image_versions.proto | 88 - .../airflow/service/v1beta1/operations.proto | 89 - .../v1beta1/environments.check_upgrade.js | 86 - .../environments.create_environment.js | 66 - .../environments.delete_environment.js | 62 - .../v1beta1/environments.get_environment.js | 61 - .../v1beta1/environments.list_environments.js | 71 - .../environments.restart_web_server.js | 63 - .../environments.update_environment.js | 206 - .../image_versions.list_image_versions.js | 75 - ...orchestration.airflow.service.v1beta1.json | 475 - .../v1beta1/src/index.ts | 27 - .../src/v1beta1/environments_client.ts | 1723 -- .../v1beta1/environments_client_config.json | 62 - .../src/v1beta1/environments_proto_list.json | 5 - .../v1beta1/src/v1beta1/gapic_metadata.json | 145 - .../src/v1beta1/image_versions_client.ts | 557 - .../v1beta1/image_versions_client_config.json | 30 - .../v1beta1/image_versions_proto_list.json | 5 - .../v1beta1/src/v1beta1/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_environments_v1beta1.ts | 1948 -- .../test/gapic_image_versions_v1beta1.ts | 491 - .../v1beta1/tsconfig.json | 19 - .../v1beta1/webpack.config.js | 64 - .../README.md | 4 + .../airflow/service/v1/environments.proto | 459 +- .../airflow/service/v1/image_versions.proto | 4 +- .../airflow/service/v1/operations.proto | 8 +- .../service/v1beta1/environments.proto | 427 +- .../service/v1beta1/image_versions.proto | 4 +- .../airflow/service/v1beta1/operations.proto | 8 +- .../protos/protos.d.ts | 8300 ++++-- .../protos/protos.js | 22583 +++++++++++----- .../protos/protos.json | 830 +- .../samples/README.md | 72 + .../v1/environments.load_snapshot.js | 0 .../v1/environments.save_snapshot.js | 0 .../v1/environments.update_environment.js | 26 +- ...loud.orchestration.airflow.service.v1.json | 106 +- .../v1beta1/environments.check_upgrade.js | 27 +- .../v1beta1/environments.load_snapshot.js | 0 .../v1beta1/environments.save_snapshot.js | 0 .../environments.update_environment.js | 37 +- ...orchestration.airflow.service.v1beta1.json | 108 +- .../src/v1/environments_client.ts | 529 +- .../src/v1/environments_client_config.json | 8 + .../src/v1/gapic_metadata.json | 20 + .../src/v1beta1/environments_client.ts | 568 +- .../v1beta1/environments_client_config.json | 8 + .../src/v1beta1/gapic_metadata.json | 20 + .../test/gapic_environments_v1.ts | 685 + .../test/gapic_environments_v1beta1.ts | 685 + 100 files changed, 25469 insertions(+), 25192 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js rename {owl-bot-staging/google-cloud-orchestration-airflow-service/v1 => packages/google-cloud-orchestration-airflow-service}/samples/generated/v1/environments.load_snapshot.js (100%) rename {owl-bot-staging/google-cloud-orchestration-airflow-service/v1 => packages/google-cloud-orchestration-airflow-service}/samples/generated/v1/environments.save_snapshot.js (100%) rename {owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1 => packages/google-cloud-orchestration-airflow-service}/samples/generated/v1beta1/environments.load_snapshot.js (100%) rename {owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1 => packages/google-cloud-orchestration-airflow-service}/samples/generated/v1beta1/environments.save_snapshot.js (100%) diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js deleted file mode 100644 index 4eacd7d3697..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -// -// 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'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/orchestration-airflow', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js deleted file mode 100644 index 481c522b00f..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// 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. ** - -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 diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js deleted file mode 100644 index 494e147865d..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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 -// -// 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md deleted file mode 100644 index 536af38a9bb..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Service: Nodejs Client diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json deleted file mode 100644 index 05f03ef3726..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@google-cloud/orchestration-airflow", - "version": "0.1.0", - "description": "Service client for Node.js", - "repository": "googleapis/nodejs-service", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google service", - "service", - "environments", - "image versions" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.62", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto deleted file mode 100644 index 0916ec9597d..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/environments.proto +++ /dev/null @@ -1,1129 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1; - -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/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; -option java_multiple_files = true; -option java_package = "com.google.cloud.orchestration.airflow.service.v1"; - -// Managed Apache Airflow Environments. -service Environments { - option (google.api.default_host) = "composer.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a new environment. - rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/environments" - body: "environment" - }; - option (google.api.method_signature) = "parent,environment"; - option (google.longrunning.operation_info) = { - response_type: "Environment" - metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" - }; - } - - // Get an existing environment. - rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/environments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List environments. - rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/environments" - }; - option (google.api.method_signature) = "parent"; - } - - // Update an environment. - rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{name=projects/*/locations/*/environments/*}" - body: "environment" - }; - option (google.api.method_signature) = "name,environment,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Environment" - metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" - }; - } - - // Delete an environment. - rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/environments/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" - }; - } - - // Creates a snapshots of a Cloud Composer environment. - // - // As a result of this operation, snapshot of environment's state is stored - // in a location specified in the SaveSnapshotRequest. - rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse" - metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" - }; - } - - // Loads a snapshot of a Cloud Composer environment. - // - // As a result of this operation, a snapshot of environment's specified in - // LoadSnapshotRequest is loaded into the environment. - rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse" - metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" - }; - } -} - -// Create a new environment. -message CreateEnvironmentRequest { - // The parent must be of the form - // "projects/{projectId}/locations/{locationId}". - string parent = 1; - - // The environment to create. - Environment environment = 2; -} - -// Get an environment. -message GetEnvironmentRequest { - // The resource name of the environment to get, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 1; -} - -// List environments in a project and location. -message ListEnvironmentsRequest { - // List environments in the given project and location, in the form: - // "projects/{projectId}/locations/{locationId}" - string parent = 1; - - // The maximum number of environments to return. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; -} - -// The environments in a project and location. -message ListEnvironmentsResponse { - // The list of environments returned by a ListEnvironmentsRequest. - repeated Environment environments = 1; - - // The page token used to query for the next page if one exists. - string next_page_token = 2; -} - -// Delete an environment. -message DeleteEnvironmentRequest { - // The environment to delete, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 1; -} - -// Update an environment. -message UpdateEnvironmentRequest { - // The relative resource name of the environment to update, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 2; - - // A patch environment. Fields specified by the `updateMask` will be copied - // from the patch environment into the environment under update. - Environment environment = 1; - - // Required. A comma-separated list of paths, relative to `Environment`, of - // fields to update. - // For example, to set the version of scikit-learn to install in the - // environment to 0.19.0 and to remove an existing installation of - // numpy, the `updateMask` parameter would include the following two - // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - // "config.softwareConfig.pypiPackages.numpy". The included patch - // environment would specify the scikit-learn version as follows: - // - // { - // "config":{ - // "softwareConfig":{ - // "pypiPackages":{ - // "scikit-learn":"==0.19.0" - // } - // } - // } - // } - // - // Note that in the above example, any existing PyPI packages - // other than scikit-learn and numpy will be unaffected. - // - // Only one update type may be included in a single request's `updateMask`. - // For example, one cannot update both the PyPI packages and - // labels in the same request. However, it is possible to update multiple - // members of a map field simultaneously in the same request. For example, - // to set the labels "label1" and "label2" while clearing "label3" (assuming - // it already exists), one can - // provide the paths "labels.label1", "labels.label2", and "labels.label3" - // and populate the patch environment as follows: - // - // { - // "labels":{ - // "label1":"new-label1-value" - // "label2":"new-label2-value" - // } - // } - // - // Note that in the above example, any existing labels that are not - // included in the `updateMask` will be unaffected. - // - // It is also possible to replace an entire map field by providing the - // map field's path in the `updateMask`. The new value of the field will - // be that which is provided in the patch environment. For example, to - // delete all pre-existing user-specified PyPI packages and - // install botocore at version 1.7.14, the `updateMask` would contain - // the path "config.softwareConfig.pypiPackages", and - // the patch environment would be the following: - // - // { - // "config":{ - // "softwareConfig":{ - // "pypiPackages":{ - // "botocore":"==1.7.14" - // } - // } - // } - // } - // - // **Note:** Only the following fields can be updated: - // - // * `config.softwareConfig.pypiPackages` - // * Replace all custom custom PyPI packages. If a replacement - // package map is not included in `environment`, all custom - // PyPI packages are cleared. It is an error to provide both - // this mask and a mask specifying an individual package. - // * `config.softwareConfig.pypiPackages.`packagename - // * Update the custom PyPI package *packagename*, - // preserving other packages. To delete the package, include it in - // `updateMask`, and omit the mapping for it in - // `environment.config.softwareConfig.pypiPackages`. It is an error - // to provide both a mask of this form and the - // `config.softwareConfig.pypiPackages` mask. - // * `labels` - // * Replace all environment labels. If a replacement labels map is not - // included in `environment`, all labels are cleared. It is an error to - // provide both this mask and a mask specifying one or more individual - // labels. - // * `labels.`labelName - // * Set the label named *labelName*, while preserving other - // labels. To delete the label, include it in `updateMask` and omit its - // mapping in `environment.labels`. It is an error to provide both a - // mask of this form and the `labels` mask. - // * `config.nodeCount` - // * Horizontally scale the number of nodes in the environment. An integer - // greater than or equal to 3 must be provided in the `config.nodeCount` - // field. Supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - // * `config.webServerNetworkAccessControl` - // * Replace the environment's current `WebServerNetworkAccessControl`. - // * `config.softwareConfig.airflowConfigOverrides` - // * Replace all Apache Airflow config overrides. If a replacement config - // overrides map is not included in `environment`, all config overrides - // are cleared. - // It is an error to provide both this mask and a mask specifying one or - // more individual config overrides. - // * `config.softwareConfig.airflowConfigOverrides.`section-name - // * Override the Apache Airflow config property *name* in the - // section named *section*, preserving other properties. To - // delete the property override, include it in `updateMask` and omit its - // mapping in - // `environment.config.softwareConfig.airflowConfigOverrides`. - // It is an error to provide both a mask of this form and the - // `config.softwareConfig.airflowConfigOverrides` mask. - // * `config.softwareConfig.envVariables` - // * Replace all environment variables. If a replacement environment - // variable map is not included in `environment`, all custom environment - // variables are cleared. - // * `config.softwareConfig.schedulerCount` - // * Horizontally scale the number of schedulers in Airflow. A positive - // integer not greater than the number of nodes must be provided in the - // `config.softwareConfig.schedulerCount` field. Supported for Cloud - // Composer environments in versions composer-1.*.*-airflow-2.*.*. - // * `config.databaseConfig.machineType` - // * Cloud SQL machine type used by Airflow database. - // It has to be one of: db-n1-standard-2, db-n1-standard-4, - // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - // environments in versions composer-1.*.*-airflow-*.*.*. - // * `config.webServerConfig.machineType` - // * Machine type on which Airflow web server is running. - // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - // or composer-n1-webserver-8. Supported for Cloud Composer environments - // in versions composer-1.*.*-airflow-*.*.*. - google.protobuf.FieldMask update_mask = 3; -} - -// Request to create a snapshot of a Cloud Composer environment. -message SaveSnapshotRequest { - // The resource name of the source environment in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string environment = 1; - - // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: - // "gs://my-bucket/snapshots". - string snapshot_location = 2; -} - -// Response to SaveSnapshotRequest. -message SaveSnapshotResponse { - // The fully-resolved Cloud Storage path of the created snapshot, - // e.g.: - // "gs://my-bucket/snapshots/project_location_environment_timestamp". - // This field is populated only if the snapshot creation was successful. - string snapshot_path = 1; -} - -// Request to load a snapshot into a Cloud Composer environment. -message LoadSnapshotRequest { - // The resource name of the target environment in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string environment = 1; - - // A Cloud Storage path to a snapshot to load, e.g.: - // "gs://my-bucket/snapshots/project_location_environment_timestamp". - string snapshot_path = 2; - - // Whether or not to skip installing Pypi packages when loading the - // environment's state. - bool skip_pypi_packages_installation = 3; - - // Whether or not to skip setting environment variables when loading the - // environment's state. - bool skip_environment_variables_setting = 4; - - // Whether or not to skip setting Airflow overrides when loading the - // environment's state. - bool skip_airflow_overrides_setting = 5; - - // Whether or not to skip copying Cloud Storage data when loading the - // environment's state. - bool skip_gcs_data_copying = 6; -} - -// Response to LoadSnapshotRequest. -message LoadSnapshotResponse { - -} - -// Configuration information for an environment. -message EnvironmentConfig { - // The size of the Cloud Composer environment. - enum EnvironmentSize { - // The size of the environment is unspecified. - ENVIRONMENT_SIZE_UNSPECIFIED = 0; - - // The environment size is small. - ENVIRONMENT_SIZE_SMALL = 1; - - // The environment size is medium. - ENVIRONMENT_SIZE_MEDIUM = 2; - - // The environment size is large. - ENVIRONMENT_SIZE_LARGE = 3; - } - - // Output only. The Kubernetes Engine cluster used to run this environment. - string gke_cluster = 1; - - // Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud - // Storage objects reside in a flat namespace, a hierarchical file tree - // can be simulated using "/"-delimited object name prefixes. DAG objects for - // this environment reside in a simulated directory with the given prefix. - string dag_gcs_prefix = 2; - - // The number of nodes in the Kubernetes Engine cluster that will be - // used to run this environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - int32 node_count = 3; - - // The configuration settings for software inside the environment. - SoftwareConfig software_config = 4; - - // The configuration used for the Kubernetes Engine cluster. - NodeConfig node_config = 5; - - // The configuration used for the Private IP Cloud Composer environment. - PrivateEnvironmentConfig private_environment_config = 7; - - // Optional. The network-level access control policy for the Airflow web server. If - // unspecified, no network-level access restrictions will be applied. - WebServerNetworkAccessControl web_server_network_access_control = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration settings for Cloud SQL instance used internally by Apache - // Airflow software. - DatabaseConfig database_config = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration settings for the Airflow web server App Engine instance. - WebServerConfig web_server_config = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption options for the Cloud Composer environment - // and its dependencies. Cannot be updated. - EncryptionConfig encryption_config = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maintenance window is the period when Cloud Composer components may - // undergo maintenance. It is defined so that maintenance is not executed - // during peak hours or critical time periods. - // - // The system will not be under maintenance for every occurrence of this - // window, but when maintenance is planned, it will be scheduled - // during the window. - // - // The maintenance window period must encompass at least 12 hours per week. - // This may be split into multiple chunks, each with a size of - // at least 4 hours. - // - // If this value is omitted, the default value for maintenance window will be - // applied. The default value is Saturday and Sunday 00-06 GMT. - MaintenanceWindow maintenance_window = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The workloads configuration settings for the GKE cluster associated with - // the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web - // server and workers workloads. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - WorkloadsConfig workloads_config = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The size of the Cloud Composer environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see - // [Airflow web - // interface](/composer/docs/how-to/accessing/airflow-web-interface)). - string airflow_uri = 6; - - // Optional. The configuration options for GKE cluster master authorized networks. - // By default master authorized networks feature is: - // - in case of private environment: enabled with no external networks - // allowlisted. - // - in case of public environment: disabled. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Recovery settings configuration of an environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// Network-level access control policy for the Airflow web server. -message WebServerNetworkAccessControl { - // Allowed IP range with user-provided description. - message AllowedIpRange { - // IP address or range, defined using CIDR notation, of requests that this - // rule applies to. - // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` - // or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. - // - // IP range prefixes should be properly truncated. For example, - // `1.2.3.4/24` should be truncated to `1.2.3.0/24`. Similarly, for IPv6, - // `2001:db8::1/32` should be truncated to `2001:db8::/32`. - string value = 1; - - // Optional. User-provided description. It must contain at most 300 characters. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // A collection of allowed IP ranges with descriptions. - repeated AllowedIpRange allowed_ip_ranges = 1; -} - -// The configuration of Cloud SQL instance that is used by the Apache Airflow -// software. -message DatabaseConfig { - // Optional. Cloud SQL machine type used by Airflow database. - // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 - // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. - // Supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration settings for the Airflow web server App Engine instance. -// Supported for Cloud Composer environments in versions -// composer-1.*.*-airflow-*.*.* -message WebServerConfig { - // Optional. Machine type on which Airflow web server is running. - // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or - // composer-n1-webserver-8. - // If not specified, composer-n1-webserver-2 will be used. - // Value custom is returned only in response, if Airflow web server parameters - // were manually changed to a non-standard values. - string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The encryption options for the Cloud Composer environment -// and its dependencies.Supported for Cloud Composer environments in versions -// composer-1.*.*-airflow-*.*.*. -message EncryptionConfig { - // Optional. Customer-managed Encryption Key available through Google's Key Management - // Service. Cannot be updated. - // If not specified, Google-managed key will be used. - string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration settings for Cloud Composer maintenance window. -// The following example: -// -// ``` -// { -// "startTime":"2019-08-01T01:00:00Z" -// "endTime":"2019-08-01T07:00:00Z" -// "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE" -// } -// ``` -// -// would define a maintenance window between 01 and 07 hours UTC during -// each Tuesday and Wednesday. -message MaintenanceWindow { - // Required. Start time of the first recurrence of the maintenance window. - google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Maintenance window end time. It is used only to calculate the duration of - // the maintenance window. - // The value for end-time must be in the future, relative to - // `start_time`. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Maintenance window recurrence. Format is a subset of - // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed - // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...` - // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`. - string recurrence = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the selection and configuration of software inside the environment. -message SoftwareConfig { - // The version of the software running in the environment. - // This encapsulates both the version of Cloud Composer functionality and the - // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. - // When used as input, the server also checks if the provided version is - // supported and denies the request for an unsupported version. - // - // The Cloud Composer portion of the image version is a full - // [semantic version](https://semver.org), or an alias in the form of major - // version number or `latest`. When an alias is provided, the server replaces - // it with the current Cloud Composer version that satisfies the alias. - // - // The Apache Airflow portion of the image version is a full semantic version - // that points to one of the supported Apache Airflow versions, or an alias in - // the form of only major or major.minor versions specified. When an alias is - // provided, the server replaces it with the latest Apache Airflow version - // that satisfies the alias and is supported in the given Cloud Composer - // version. - // - // In all cases, the resolved image version is stored in the same field. - // - // See also [version - // list](/composer/docs/concepts/versioning/composer-versions) and [versioning - // overview](/composer/docs/concepts/versioning/composer-versioning-overview). - string image_version = 1; - - // Optional. Apache Airflow configuration properties to override. - // - // Property keys contain the section and property names, separated by a - // hyphen, for example "core-dags_are_paused_at_creation". Section names must - // not contain hyphens ("-"), opening square brackets ("["), or closing - // square brackets ("]"). The property name must not be empty and must not - // contain an equals sign ("=") or semicolon (";"). Section and property names - // must not contain a period ("."). Apache Airflow configuration property - // names must be written in - // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property values can - // contain any character, and can be written in any lower/upper case format. - // - // Certain Apache Airflow configuration property values are - // [blocked](/composer/docs/concepts/airflow-configurations), - // and cannot be overridden. - map airflow_config_overrides = 2; - - // Optional. Custom Python Package Index (PyPI) packages to be installed in - // the environment. - // - // Keys refer to the lowercase package name such as "numpy" - // and values are the lowercase extras and version specifier such as - // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To specify a - // package without pinning it to a version specifier, use the empty string as - // the value. - map pypi_packages = 3; - - // Optional. Additional environment variables to provide to the Apache Airflow - // scheduler, worker, and webserver processes. - // - // Environment variable names must match the regular expression - // `[a-zA-Z_][a-zA-Z0-9_]*`. They cannot specify Apache Airflow - // software configuration overrides (they cannot match the regular expression - // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of the - // following reserved names: - // - // * `AIRFLOW_HOME` - // * `C_FORCE_ROOT` - // * `CONTAINER_NAME` - // * `DAGS_FOLDER` - // * `GCP_PROJECT` - // * `GCS_BUCKET` - // * `GKE_CLUSTER_NAME` - // * `SQL_DATABASE` - // * `SQL_INSTANCE` - // * `SQL_PASSWORD` - // * `SQL_PROJECT` - // * `SQL_REGION` - // * `SQL_USER` - map env_variables = 4; - - // Optional. The major version of Python used to run the Apache Airflow - // scheduler, worker, and webserver processes. - // - // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be - // updated. - // - // This field is only supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use - // Python major version 3. - string python_version = 6; - - // Optional. The number of schedulers for Airflow. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-2.*.*. - int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for controlling how IPs are allocated in the -// GKE cluster running the Apache Airflow software. -message IPAllocationPolicy { - // Optional. Whether or not to enable Alias IPs in the GKE cluster. - // If `true`, a VPC-native cluster is created. - // - // This field is only supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use - // VPC-native GKE clusters. - bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Configuration of allocating IP addresses for pods in the GKE cluster. - oneof cluster_ip_allocation { - // Optional. The name of the GKE cluster's secondary range used to allocate - // IP addresses to pods. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The IP address range used to allocate IP addresses to pods in - // the GKE cluster. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - // - // Set to blank to have GKE choose a range with the default size. - // - // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific - // netmask. - // - // Set to a - // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string cluster_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration of allocating IP addresses for services in the GKE cluster. - oneof services_ip_allocation { - // Optional. The name of the services' secondary range used to allocate - // IP addresses to the GKE cluster. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The IP address range of the services IP addresses in this - // GKE cluster. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - // - // Set to blank to have GKE choose a range with the default size. - // - // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific - // netmask. - // - // Set to a - // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - string services_ipv4_cidr_block = 5 [(google.api.field_behavior) = OPTIONAL]; - } -} - -// The configuration information for the Kubernetes Engine nodes running -// the Apache Airflow software. -message NodeConfig { - // Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which - // to deploy the VMs used to run the Apache Airflow software, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/zones/{zoneId}". - // - // This `location` must belong to the enclosing environment's project and - // location. If both this field and `nodeConfig.machineType` are specified, - // `nodeConfig.machineType` must belong to this `location`; if both are - // unspecified, the service will pick a zone in the Compute Engine region - // corresponding to the Cloud Composer location, and propagate that choice to - // both fields. If only one field (`location` or `nodeConfig.machineType`) is - // specified, the location information from the specified field will be - // propagated to the unspecified field. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string location = 1; - - // Optional. The Compute Engine - // [machine type](/compute/docs/machine-types) used for cluster instances, - // specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTypeId}". - // - // The `machineType` must belong to the enclosing environment's project and - // location. If both this field and `nodeConfig.location` are specified, - // this `machineType` must belong to the `nodeConfig.location`; if both are - // unspecified, the service will pick a zone in the Compute Engine region - // corresponding to the Cloud Composer location, and propagate that choice to - // both fields. If exactly one of this field and `nodeConfig.location` is - // specified, the location information from the specified field will be - // propagated to the unspecified field. - // - // The `machineTypeId` must not be a [shared-core machine - // type](/compute/docs/machine-types#sharedcore). - // - // If this field is unspecified, the `machineTypeId` defaults - // to "n1-standard-1". - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string machine_type = 2; - - // Optional. The Compute Engine network to be used for machine - // communications, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/global/networks/{networkId}". - // - // If unspecified, the "default" network ID in the environment's project is - // used. If a [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets) - // is provided, `nodeConfig.subnetwork` must also be provided. For - // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements, see - // `nodeConfig.subnetwork`. - string network = 3; - - // Optional. The Compute Engine subnetwork to be used for machine - // communications, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" - // - // If a subnetwork is provided, `nodeConfig.network` must also be provided, - // and the subnetwork must belong to the enclosing environment's project and - // location. - string subnetwork = 4; - - // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. - // If unspecified, defaults to 100GB. Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - int32 disk_size_gb = 5; - - // Optional. The set of Google API scopes to be made available on all - // node VMs. If `oauth_scopes` is empty, defaults to - // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - repeated string oauth_scopes = 6; - - // Optional. The Google Cloud Platform Service Account to be used by the node - // VMs. If a service account is not specified, the "default" Compute Engine - // service account is used. Cannot be updated. - string service_account = 7; - - // Optional. The list of instance tags applied to all node VMs. Tags are used - // to identify valid sources or targets for network firewalls. Each tag within - // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - // Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - repeated string tags = 8; - - // Optional. The configuration for controlling how IPs are allocated in the GKE cluster. - IPAllocationPolicy ip_allocation_policy = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines - // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for - // all destination addresses, except between pods traffic. - // - // See: - // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent - bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration options for the private GKE cluster in a Cloud Composer -// environment. -message PrivateClusterConfig { - // Optional. If `true`, access to the public endpoint of the GKE cluster is - // denied. - bool enable_private_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IPv4 range for GKE master will be reserved. If - // left blank, the default value of '172.16.0.0/23' is used. - string master_ipv4_cidr_block = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range in CIDR notation to use for the hosted master network. This - // range is used for assigning internal IP addresses to the GKE cluster - // master or set of masters and to the internal load balancer virtual IP. - // This range must not overlap with any other ranges in use - // within the cluster's network. - string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration options for networking connections in the Composer 2 -// environment. -message NetworkingConfig { - // Represents connection type between Composer environment in Customer - // Project and the corresponding Tenant project, from a predefined list - // of available connection modes. - enum ConnectionType { - // No specific connection type was requested, so the environment uses - // the default value corresponding to the rest of its configuration. - CONNECTION_TYPE_UNSPECIFIED = 0; - - // Requests the use of VPC peerings for connecting the Customer and Tenant - // projects. - VPC_PEERING = 1; - - // Requests the use of Private Service Connect for connecting the Customer - // and Tenant projects. - PRIVATE_SERVICE_CONNECT = 2; - } - - // Optional. Indicates the user requested specifc connection type between Tenant and - // Customer projects. - // You cannot set networking connection type in public IP environment. - ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration information for configuring a Private IP Cloud Composer -// environment. -message PrivateEnvironmentConfig { - // Optional. If `true`, a Private IP Cloud Composer environment is created. - // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be - // set to true for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for the private GKE cluster for a Private IP - // Cloud Composer environment. - PrivateClusterConfig private_cluster_config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IP range for web server will be reserved. Needs - // to be disjoint from `private_cluster_config.master_ipv4_cidr_block` and - // `cloud_sql_ipv4_cidr_block`. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IP range in tenant project will be reserved for - // Cloud SQL. Needs to be disjoint from `web_server_ipv4_cidr_block`. - string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range reserved for the tenant project's App Engine VMs. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant - // project will be reserved. Needs to be disjoint from - // private_cluster_config.master_ipv4_cidr_block and - // cloud_sql_ipv4_cidr_block. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - string cloud_composer_network_ipv4_cidr_block = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range reserved for the tenant project's Cloud Composer network. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for - // `IPAllocationPolicy.cluster_ipv4_cidr_block` and - // `IPAllocationPolicy.service_ipv4_cidr_block`. - bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When specified, the environment will use Private Service Connect - // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, - // and the PSC endpoint in the Customer Project will use an IP address from - // this subnetwork. - string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for the network connections configuration in the environment. - NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// The Kubernetes workloads configuration for GKE cluster associated with the -// Cloud Composer environment. Supported for Cloud Composer environments in -// versions composer-2.*.*-airflow-*.*.* and newer. -message WorkloadsConfig { - // Configuration for resources used by Airflow schedulers. - message SchedulerResource { - // Optional. CPU request and limit for a single Airflow scheduler replica. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for a single Airflow scheduler replica. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for a single Airflow scheduler replica. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of schedulers. - int32 count = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for resources used by Airflow web server. - message WebServerResource { - // Optional. CPU request and limit for Airflow web server. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for Airflow web server. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for Airflow web server. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for resources used by Airflow workers. - message WorkerResource { - // Optional. CPU request and limit for a single Airflow worker replica. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for a single Airflow worker replica. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for a single Airflow worker replica. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum number of workers for autoscaling. - int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of workers for autoscaling. - int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Resources used by Airflow schedulers. - SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resources used by Airflow web server. - WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resources used by Airflow workers. - WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The Recovery settings of an environment. -message RecoveryConfig { - // Optional. The configuration for scheduled snapshot creation mechanism. - ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration for scheduled snapshot creation mechanism. -message ScheduledSnapshotsConfig { - // Optional. Whether scheduled snapshots creation is enabled. - bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage location for storing automatically created snapshots. - string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The cron expression representing the time when snapshots creation mechanism - // runs. This field is subject to additional validation around frequency of - // execution. - string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. - string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration options for the master authorized networks feature. Enabled -// master authorized networks will disallow all external traffic to access -// Kubernetes master through HTTPS except traffic from the given CIDR blocks, -// Google Compute Engine Public IPs and Google Prod IPs. -message MasterAuthorizedNetworksConfig { - // CIDR block with an optional name. - message CidrBlock { - // User-defined name that identifies the CIDR block. - string display_name = 1; - - // CIDR block that must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks feature is enabled. - bool enabled = 1; - - // Up to 50 external networks that could access Kubernetes master through - // HTTPS. - repeated CidrBlock cidr_blocks = 2; -} - -// An environment for running orchestration tasks. -message Environment { - option (google.api.resource) = { - type: "composer.googleapis.com/Environment" - pattern: "projects/{project}/locations/{location}/environments/{environment}" - }; - - // State of the environment. - enum State { - // The state of the environment is unknown. - STATE_UNSPECIFIED = 0; - - // The environment is in the process of being created. - CREATING = 1; - - // The environment is currently running and healthy. It is ready for use. - RUNNING = 2; - - // The environment is being updated. It remains usable but cannot receive - // additional update requests or be deleted at this time. - UPDATING = 3; - - // The environment is undergoing deletion. It cannot be used. - DELETING = 4; - - // The environment has encountered an error and cannot be used. - ERROR = 5; - } - - // The resource name of the environment, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - // - // EnvironmentId must start with a lowercase letter followed by up to 63 - // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - string name = 1; - - // Configuration parameters for this environment. - EnvironmentConfig config = 2; - - // Output only. The UUID (Universally Unique IDentifier) associated with this environment. - // This value is generated when the environment is created. - string uuid = 3; - - // The current state of the environment. - State state = 4; - - // Output only. The time at which this environment was created. - google.protobuf.Timestamp create_time = 5; - - // Output only. The time at which this environment was last modified. - google.protobuf.Timestamp update_time = 6; - - // Optional. User-defined labels for this environment. - // The labels map can contain no more than 64 entries. Entries of the labels - // map are UTF8 strings that comply with the following restrictions: - // - // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} - // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} - // * Both keys and values are additionally constrained to be <= 128 bytes in - // size. - map labels = 7; -} - -// Message containing information about the result of an upgrade check -// operation. -message CheckUpgradeResponse { - // Whether there were python modules conflict during image build. - enum ConflictResult { - // It is unknown whether build had conflicts or not. - CONFLICT_RESULT_UNSPECIFIED = 0; - - // There were python packages conflicts. - CONFLICT = 1; - - // There were no python packages conflicts. - NO_CONFLICT = 2; - } - - // Output only. Url for a docker build log of an upgraded image. - string build_log_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Whether build has succeeded or failed on modules conflicts. - ConflictResult contains_pypi_modules_conflict = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Extract from a docker image build log containing information about pypi - // modules conflicts. - string pypi_conflict_build_log_extract = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Composer image for which the build was happening. - string image_version = 5; - - // Pypi dependencies specified in the environment configuration, at the time - // when the build was triggered. - map pypi_dependencies = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto deleted file mode 100644 index 8226c463b80..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto +++ /dev/null @@ -1,88 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/type/date.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; -option java_multiple_files = true; -option java_package = "com.google.cloud.orchestration.airflow.service.v1"; - -// Readonly service to query available ImageVersions. -service ImageVersions { - option (google.api.default_host) = "composer.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // List ImageVersions for provided location. - rpc ListImageVersions(ListImageVersionsRequest) returns (ListImageVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/imageVersions" - }; - option (google.api.method_signature) = "parent"; - } -} - -// List ImageVersions in a project and location. -message ListImageVersionsRequest { - // List ImageVersions in the given project and location, in the form: - // "projects/{projectId}/locations/{locationId}" - string parent = 1; - - // The maximum number of image_versions to return. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; - - // Whether or not image versions from old releases should be included. - bool include_past_releases = 4; -} - -// The ImageVersions in a project and location. -message ListImageVersionsResponse { - // The list of supported ImageVersions in a location. - repeated ImageVersion image_versions = 1; - - // The page token used to query for the next page if one exists. - string next_page_token = 2; -} - -// ImageVersion information -message ImageVersion { - // The string identifier of the ImageVersion, in the form: - // "composer-x.y.z-airflow-a.b.c" - string image_version_id = 1; - - // Whether this is the default ImageVersion used by Composer during - // environment creation if no input ImageVersion is specified. - bool is_default = 2; - - // supported python versions - repeated string supported_python_versions = 3; - - // The date of the version release. - google.type.Date release_date = 4; - - // Whether it is impossible to create an environment with the image version. - bool creation_disabled = 5; - - // Whether it is impossible to upgrade an environment running with the image - // version. - bool upgrade_disabled = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto deleted file mode 100644 index 332e09623b9..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/protos/google/cloud/orchestration/airflow/service/v1/operations.proto +++ /dev/null @@ -1,93 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1; - -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1;service"; -option java_multiple_files = true; -option java_outer_classname = "OperationsProto"; -option java_package = "com.google.cloud.orchestration.airflow.service.v1"; - -// Metadata describing an operation. -message OperationMetadata { - // An enum describing the overall state of an operation. - enum State { - option allow_alias = true; - - // Unused. - STATE_UNSPECIFIED = 0; - - // The operation has been created but is not yet started. - PENDING = 1; - - // The operation is underway. - RUNNING = 2; - - // The operation completed successfully. - SUCCEEDED = 3; - - SUCCESSFUL = 3; - - // The operation is no longer running but did not succeed. - FAILED = 4; - } - - // Type of longrunning operation. - enum Type { - // Unused. - TYPE_UNSPECIFIED = 0; - - // A resource creation operation. - CREATE = 1; - - // A resource deletion operation. - DELETE = 2; - - // A resource update operation. - UPDATE = 3; - - // A resource check operation. - CHECK = 4; - - // Saves snapshot of the resource operation. - SAVE_SNAPSHOT = 5; - - // Loads snapshot of the resource operation. - LOAD_SNAPSHOT = 6; - } - - // Output only. The current operation state. - State state = 1; - - // Output only. The type of operation being performed. - Type operation_type = 2; - - // Output only. The resource being operated on, as a [relative resource name]( - // /apis/design/resource_names#relative_resource_name). - string resource = 3; - - // Output only. The UUID of the resource being operated on. - string resource_uuid = 4; - - // Output only. The time the operation was submitted to the server. - google.protobuf.Timestamp create_time = 5; - - // Output only. The time when the operation terminated, regardless of its success. - // This field is unset if the operation is still ongoing. - google.protobuf.Timestamp end_time = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js deleted file mode 100644 index facdb566575..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.create_environment.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_Environments_CreateEnvironment_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. - */ - /** - * The parent must be of the form - * "projects/{projectId}/locations/{locationId}". - */ - // const parent = 'abc123' - /** - * The environment to create. - */ - // const environment = {} - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callCreateEnvironment() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.createEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateEnvironment(); - // [END composer_v1_generated_Environments_CreateEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js deleted file mode 100644 index 74dccacbe5e..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.delete_environment.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_Environments_DeleteEnvironment_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. - */ - /** - * The environment to delete, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callDeleteEnvironment() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.deleteEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteEnvironment(); - // [END composer_v1_generated_Environments_DeleteEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js deleted file mode 100644 index 56aadc4191b..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.get_environment.js +++ /dev/null @@ -1,61 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_Environments_GetEnvironment_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. - */ - /** - * The resource name of the environment to get, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callGetEnvironment() { - // Construct request - const request = { - }; - - // Run request - const response = await serviceClient.getEnvironment(request); - console.log(response); - } - - callGetEnvironment(); - // [END composer_v1_generated_Environments_GetEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js deleted file mode 100644 index 0d6aaaca77d..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.list_environments.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_Environments_ListEnvironments_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. - */ - /** - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - */ - // const parent = 'abc123' - /** - * The maximum number of environments to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callListEnvironments() { - // Construct request - const request = { - }; - - // Run request - const iterable = await serviceClient.listEnvironmentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEnvironments(); - // [END composer_v1_generated_Environments_ListEnvironments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js deleted file mode 100644 index aaf10d52979..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.update_environment.js +++ /dev/null @@ -1,184 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_Environments_UpdateEnvironment_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. - */ - /** - * The relative resource name of the environment to update, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - /** - * A patch environment. Fields specified by the `updateMask` will be copied - * from the patch environment into the environment under update. - */ - // const environment = {} - /** - * Required. A comma-separated list of paths, relative to `Environment`, of - * fields to update. - * For example, to set the version of scikit-learn to install in the - * environment to 0.19.0 and to remove an existing installation of - * numpy, the `updateMask` parameter would include the following two - * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - * "config.softwareConfig.pypiPackages.numpy". The included patch - * environment would specify the scikit-learn version as follows: - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "scikit-learn":"==0.19.0" - * } - * } - * } - * } - * Note that in the above example, any existing PyPI packages - * other than scikit-learn and numpy will be unaffected. - * Only one update type may be included in a single request's `updateMask`. - * For example, one cannot update both the PyPI packages and - * labels in the same request. However, it is possible to update multiple - * members of a map field simultaneously in the same request. For example, - * to set the labels "label1" and "label2" while clearing "label3" (assuming - * it already exists), one can - * provide the paths "labels.label1", "labels.label2", and "labels.label3" - * and populate the patch environment as follows: - * { - * "labels":{ - * "label1":"new-label1-value" - * "label2":"new-label2-value" - * } - * } - * Note that in the above example, any existing labels that are not - * included in the `updateMask` will be unaffected. - * It is also possible to replace an entire map field by providing the - * map field's path in the `updateMask`. The new value of the field will - * be that which is provided in the patch environment. For example, to - * delete all pre-existing user-specified PyPI packages and - * install botocore at version 1.7.14, the `updateMask` would contain - * the path "config.softwareConfig.pypiPackages", and - * the patch environment would be the following: - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "botocore":"==1.7.14" - * } - * } - * } - * } - * **Note:** Only the following fields can be updated: - * * `config.softwareConfig.pypiPackages` - * * Replace all custom custom PyPI packages. If a replacement - * package map is not included in `environment`, all custom - * PyPI packages are cleared. It is an error to provide both - * this mask and a mask specifying an individual package. - * * `config.softwareConfig.pypiPackages.`packagename - * * Update the custom PyPI package *packagename*, - * preserving other packages. To delete the package, include it in - * `updateMask`, and omit the mapping for it in - * `environment.config.softwareConfig.pypiPackages`. It is an error - * to provide both a mask of this form and the - * `config.softwareConfig.pypiPackages` mask. - * * `labels` - * * Replace all environment labels. If a replacement labels map is not - * included in `environment`, all labels are cleared. It is an error to - * provide both this mask and a mask specifying one or more individual - * labels. - * * `labels.`labelName - * * Set the label named *labelName*, while preserving other - * labels. To delete the label, include it in `updateMask` and omit its - * mapping in `environment.labels`. It is an error to provide both a - * mask of this form and the `labels` mask. - * * `config.nodeCount` - * * Horizontally scale the number of nodes in the environment. An integer - * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. Supported for Cloud Composer environments in versions - * composer-1.*.*-airflow-*.*.*. - * * `config.webServerNetworkAccessControl` - * * Replace the environment's current `WebServerNetworkAccessControl`. - * * `config.softwareConfig.airflowConfigOverrides` - * * Replace all Apache Airflow config overrides. If a replacement config - * overrides map is not included in `environment`, all config overrides - * are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual config overrides. - * * `config.softwareConfig.airflowConfigOverrides.`section-name - * * Override the Apache Airflow config property *name* in the - * section named *section*, preserving other properties. To - * delete the property override, include it in `updateMask` and omit its - * mapping in - * `environment.config.softwareConfig.airflowConfigOverrides`. - * It is an error to provide both a mask of this form and the - * `config.softwareConfig.airflowConfigOverrides` mask. - * * `config.softwareConfig.envVariables` - * * Replace all environment variables. If a replacement environment - * variable map is not included in `environment`, all custom environment - * variables are cleared. - * * `config.softwareConfig.schedulerCount` - * * Horizontally scale the number of schedulers in Airflow. A positive - * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. Supported for Cloud - * Composer environments in versions composer-1.*.*-airflow-2.*.*. - * * `config.databaseConfig.machineType` - * * Cloud SQL machine type used by Airflow database. - * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - * environments in versions composer-1.*.*-airflow-*.*.*. - * * `config.webServerConfig.machineType` - * * Machine type on which Airflow web server is running. - * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. Supported for Cloud Composer environments - * in versions composer-1.*.*-airflow-*.*.*. - */ - // const updateMask = {} - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callUpdateEnvironment() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.updateEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateEnvironment(); - // [END composer_v1_generated_Environments_UpdateEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js deleted file mode 100644 index 718176b5a60..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/image_versions.list_image_versions.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1_generated_ImageVersions_ListImageVersions_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. - */ - /** - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - */ - // const parent = 'abc123' - /** - * The maximum number of image_versions to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - /** - * Whether or not image versions from old releases should be included. - */ - // const includePastReleases = true - - // Imports the Service library - const {ImageVersionsClient} = require('@google-cloud/orchestration-airflow').v1; - - // Instantiates a client - const serviceClient = new ImageVersionsClient(); - - async function callListImageVersions() { - // Construct request - const request = { - }; - - // Run request - const iterable = await serviceClient.listImageVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListImageVersions(); - // [END composer_v1_generated_ImageVersions_ListImageVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json deleted file mode 100644 index b304ff613b5..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json +++ /dev/null @@ -1,391 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-service", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.orchestration.airflow.service.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "composer_v1_generated_Environments_CreateEnvironment_async", - "title": "Environments createEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Create a new environment.", - "canonical": true, - "file": "environments.create_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CreateEnvironment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "environment", - "type": ".google.cloud.orchestration.airflow.service.v1.Environment" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "CreateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CreateEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_GetEnvironment_async", - "title": "Environments getEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Get an existing environment.", - "canonical": true, - "file": "environments.get_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.GetEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1.Environment", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "GetEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.GetEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_ListEnvironments_async", - "title": "Environments listEnvironments Sample", - "origin": "API_DEFINITION", - "description": " List environments.", - "canonical": true, - "file": "environments.list_environments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEnvironments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ListEnvironments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1.ListEnvironmentsResponse", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "ListEnvironments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.ListEnvironments", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_UpdateEnvironment_async", - "title": "Environments updateEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Update an environment.", - "canonical": true, - "file": "environments.update_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 176, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.UpdateEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "environment", - "type": ".google.cloud.orchestration.airflow.service.v1.Environment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "UpdateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.UpdateEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_DeleteEnvironment_async", - "title": "Environments deleteEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Delete an environment.", - "canonical": true, - "file": "environments.delete_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DeleteEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "DeleteEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.DeleteEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_SaveSnapshot_async", - "title": "Environments saveSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", - "canonical": true, - "file": "environments.save_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SaveSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", - "async": true, - "parameters": [ - { - "name": "environment", - "type": "TYPE_STRING" - }, - { - "name": "snapshot_location", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "SaveSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_Environments_LoadSnapshot_async", - "title": "Environments loadSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", - "canonical": true, - "file": "environments.load_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LoadSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", - "async": true, - "parameters": [ - { - "name": "environment", - "type": "TYPE_STRING" - }, - { - "name": "snapshot_path", - "type": "TYPE_STRING" - }, - { - "name": "skip_pypi_packages_installation", - "type": "TYPE_BOOL" - }, - { - "name": "skip_environment_variables_setting", - "type": "TYPE_BOOL" - }, - { - "name": "skip_airflow_overrides_setting", - "type": "TYPE_BOOL" - }, - { - "name": "skip_gcs_data_copying", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" - }, - "method": { - "shortName": "LoadSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1_generated_ImageVersions_ListImageVersions_async", - "title": "Environments listImageVersions Sample", - "origin": "API_DEFINITION", - "description": " List ImageVersions for provided location.", - "canonical": true, - "file": "image_versions.list_image_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "include_past_releases", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse", - "client": { - "shortName": "ImageVersionsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersionsClient" - }, - "method": { - "shortName": "ListImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersions", - "service": { - "shortName": "ImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1.ImageVersions" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts deleted file mode 100644 index 7907a6be7f0..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// 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 -// -// 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 v1 from './v1'; -const EnvironmentsClient = v1.EnvironmentsClient; -type EnvironmentsClient = v1.EnvironmentsClient; -const ImageVersionsClient = v1.ImageVersionsClient; -type ImageVersionsClient = v1.ImageVersionsClient; -export {v1, EnvironmentsClient, ImageVersionsClient}; -export default {v1, EnvironmentsClient, ImageVersionsClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts deleted file mode 100644 index f6c5a68bb50..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client.ts +++ /dev/null @@ -1,1473 +0,0 @@ -// 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 -// -// 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. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/environments_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './environments_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Managed Apache Airflow Environments. - * @class - * @memberof v1 - */ -export class EnvironmentsClient { - 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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - environmentsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of EnvironmentsClient. - * - * @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/main/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] - * @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 {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @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}. - * @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 EnvironmentsClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof EnvironmentsClient; - 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 = 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. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - 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 ? gaxInstance.fallback : gaxInstance; - - // 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. - this._opts = opts; - - // 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; - } - - // Determine the client header string. - 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/${this._gaxModule.version}`); - } - 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}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - environmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/environments/{environment}' - ), - }; - - // 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 = { - listEnvironments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'environments') - }; - - 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.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createEnvironmentResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.Environment') as gax.protobuf.Type; - const createEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; - const updateEnvironmentResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.Environment') as gax.protobuf.Type; - const updateEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; - const deleteEnvironmentResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; - const saveSnapshotResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse') as gax.protobuf.Type; - const saveSnapshotMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; - const loadSnapshotResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse') as gax.protobuf.Type; - const loadSnapshotMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEnvironmentResponse.decode.bind(createEnvironmentResponse), - createEnvironmentMetadata.decode.bind(createEnvironmentMetadata)), - updateEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), - updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata)), - deleteEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), - deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata)), - saveSnapshot: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - saveSnapshotResponse.decode.bind(saveSnapshotResponse), - saveSnapshotMetadata.decode.bind(saveSnapshotMetadata)), - loadSnapshot: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - loadSnapshotResponse.decode.bind(loadSnapshotResponse), - loadSnapshotMetadata.decode.bind(loadSnapshotMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.orchestration.airflow.service.v1.Environments', 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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * 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.environmentsStub) { - return this.environmentsStub; - } - - // Put together the "service stub" for - // google.cloud.orchestration.airflow.service.v1.Environments. - this.environmentsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1.Environments') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.orchestration.airflow.service.v1.Environments, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const environmentsStubMethods = - ['createEnvironment', 'getEnvironment', 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', 'saveSnapshot', 'loadSnapshot']; - for (const methodName of environmentsStubMethods) { - const callPromise = this.environmentsStub.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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.environmentsStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'composer.googleapis.com'; - } - - /** - * 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 'composer.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Get an existing environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource name of the environment to get, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. - * 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/v1/environments.get_environment.js - * region_tag:composer_v1_generated_Environments_GetEnvironment_async - */ - getEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|undefined, {}|undefined - ]>; - getEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): void; - getEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, - callback: Callback< - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): void; - getEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1.IGetEnvironmentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getEnvironment(request, options, callback); - } - -/** - * Create a new environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent must be of the form - * "projects/{projectId}/locations/{locationId}". - * @param {google.cloud.orchestration.airflow.service.v1.Environment} request.environment - * The environment 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/v1/environments.create_environment.js - * region_tag:composer_v1_generated_Environments_CreateEnvironment_async - */ - createEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.ICreateEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEnvironment()`. - * @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 include:samples/generated/v1/environments.create_environment.js - * region_tag:composer_v1_generated_Environments_CreateEnvironment_async - */ - async checkCreateEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update an environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The relative resource name of the environment to update, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {google.cloud.orchestration.airflow.service.v1.Environment} request.environment - * A patch environment. Fields specified by the `updateMask` will be copied - * from the patch environment into the environment under update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A comma-separated list of paths, relative to `Environment`, of - * fields to update. - * For example, to set the version of scikit-learn to install in the - * environment to 0.19.0 and to remove an existing installation of - * numpy, the `updateMask` parameter would include the following two - * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - * "config.softwareConfig.pypiPackages.numpy". The included patch - * environment would specify the scikit-learn version as follows: - * - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "scikit-learn":"==0.19.0" - * } - * } - * } - * } - * - * Note that in the above example, any existing PyPI packages - * other than scikit-learn and numpy will be unaffected. - * - * Only one update type may be included in a single request's `updateMask`. - * For example, one cannot update both the PyPI packages and - * labels in the same request. However, it is possible to update multiple - * members of a map field simultaneously in the same request. For example, - * to set the labels "label1" and "label2" while clearing "label3" (assuming - * it already exists), one can - * provide the paths "labels.label1", "labels.label2", and "labels.label3" - * and populate the patch environment as follows: - * - * { - * "labels":{ - * "label1":"new-label1-value" - * "label2":"new-label2-value" - * } - * } - * - * Note that in the above example, any existing labels that are not - * included in the `updateMask` will be unaffected. - * - * It is also possible to replace an entire map field by providing the - * map field's path in the `updateMask`. The new value of the field will - * be that which is provided in the patch environment. For example, to - * delete all pre-existing user-specified PyPI packages and - * install botocore at version 1.7.14, the `updateMask` would contain - * the path "config.softwareConfig.pypiPackages", and - * the patch environment would be the following: - * - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "botocore":"==1.7.14" - * } - * } - * } - * } - * - * **Note:** Only the following fields can be updated: - * - * * `config.softwareConfig.pypiPackages` - * * Replace all custom custom PyPI packages. If a replacement - * package map is not included in `environment`, all custom - * PyPI packages are cleared. It is an error to provide both - * this mask and a mask specifying an individual package. - * * `config.softwareConfig.pypiPackages.`packagename - * * Update the custom PyPI package *packagename*, - * preserving other packages. To delete the package, include it in - * `updateMask`, and omit the mapping for it in - * `environment.config.softwareConfig.pypiPackages`. It is an error - * to provide both a mask of this form and the - * `config.softwareConfig.pypiPackages` mask. - * * `labels` - * * Replace all environment labels. If a replacement labels map is not - * included in `environment`, all labels are cleared. It is an error to - * provide both this mask and a mask specifying one or more individual - * labels. - * * `labels.`labelName - * * Set the label named *labelName*, while preserving other - * labels. To delete the label, include it in `updateMask` and omit its - * mapping in `environment.labels`. It is an error to provide both a - * mask of this form and the `labels` mask. - * * `config.nodeCount` - * * Horizontally scale the number of nodes in the environment. An integer - * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. Supported for Cloud Composer environments in versions - * composer-1.*.*-airflow-*.*.*. - * * `config.webServerNetworkAccessControl` - * * Replace the environment's current `WebServerNetworkAccessControl`. - * * `config.softwareConfig.airflowConfigOverrides` - * * Replace all Apache Airflow config overrides. If a replacement config - * overrides map is not included in `environment`, all config overrides - * are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual config overrides. - * * `config.softwareConfig.airflowConfigOverrides.`section-name - * * Override the Apache Airflow config property *name* in the - * section named *section*, preserving other properties. To - * delete the property override, include it in `updateMask` and omit its - * mapping in - * `environment.config.softwareConfig.airflowConfigOverrides`. - * It is an error to provide both a mask of this form and the - * `config.softwareConfig.airflowConfigOverrides` mask. - * * `config.softwareConfig.envVariables` - * * Replace all environment variables. If a replacement environment - * variable map is not included in `environment`, all custom environment - * variables are cleared. - * * `config.softwareConfig.schedulerCount` - * * Horizontally scale the number of schedulers in Airflow. A positive - * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. Supported for Cloud - * Composer environments in versions composer-1.*.*-airflow-2.*.*. - * * `config.databaseConfig.machineType` - * * Cloud SQL machine type used by Airflow database. - * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - * environments in versions composer-1.*.*-airflow-*.*.*. - * * `config.webServerConfig.machineType` - * * Machine type on which Airflow web server is running. - * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. Supported for Cloud Composer environments - * in versions composer-1.*.*-airflow-*.*.*. - * @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/v1/environments.update_environment.js - * region_tag:composer_v1_generated_Environments_UpdateEnvironment_async - */ - updateEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IUpdateEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateEnvironment()`. - * @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 include:samples/generated/v1/environments.update_environment.js - * region_tag:composer_v1_generated_Environments_UpdateEnvironment_async - */ - async checkUpdateEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Delete an environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The environment to delete, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @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/v1/environments.delete_environment.js - * region_tag:composer_v1_generated_Environments_DeleteEnvironment_async - */ - deleteEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEnvironment()`. - * @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 include:samples/generated/v1/environments.delete_environment.js - * region_tag:composer_v1_generated_Environments_DeleteEnvironment_async - */ - async checkDeleteEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a snapshots of a Cloud Composer environment. - * - * As a result of this operation, snapshot of environment's state is stored - * in a location specified in the SaveSnapshotRequest. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.environment - * The resource name of the source environment in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {string} request.snapshotLocation - * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: - * "gs://my-bucket/snapshots". - * @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/v1/environments.save_snapshot.js - * region_tag:composer_v1_generated_Environments_SaveSnapshot_async - */ - saveSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - saveSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - saveSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - saveSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'environment': request.environment ?? '', - }); - this.initialize(); - return this.innerApiCalls.saveSnapshot(request, options, callback); - } -/** - * Check the status of the long running operation returned by `saveSnapshot()`. - * @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 include:samples/generated/v1/environments.save_snapshot.js - * region_tag:composer_v1_generated_Environments_SaveSnapshot_async - */ - async checkSaveSnapshotProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.saveSnapshot, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Loads a snapshot of a Cloud Composer environment. - * - * As a result of this operation, a snapshot of environment's specified in - * LoadSnapshotRequest is loaded into the environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.environment - * The resource name of the target environment in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {string} request.snapshotPath - * A Cloud Storage path to a snapshot to load, e.g.: - * "gs://my-bucket/snapshots/project_location_environment_timestamp". - * @param {boolean} request.skipPypiPackagesInstallation - * Whether or not to skip installing Pypi packages when loading the - * environment's state. - * @param {boolean} request.skipEnvironmentVariablesSetting - * Whether or not to skip setting environment variables when loading the - * environment's state. - * @param {boolean} request.skipAirflowOverridesSetting - * Whether or not to skip setting Airflow overrides when loading the - * environment's state. - * @param {boolean} request.skipGcsDataCopying - * Whether or not to skip copying Cloud Storage data when loading the - * environment's state. - * @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/v1/environments.load_snapshot.js - * region_tag:composer_v1_generated_Environments_LoadSnapshot_async - */ - loadSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - loadSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - loadSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - loadSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'environment': request.environment ?? '', - }); - this.initialize(); - return this.innerApiCalls.loadSnapshot(request, options, callback); - } -/** - * Check the status of the long running operation returned by `loadSnapshot()`. - * @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 include:samples/generated/v1/environments.load_snapshot.js - * region_tag:composer_v1_generated_Environments_LoadSnapshot_async - */ - async checkLoadSnapshotProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.loadSnapshot, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List environments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. - * 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. - * Note that it can affect your quota. - * We recommend using `listEnvironmentsAsync()` - * 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. - */ - listEnvironments( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[], - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse - ]>; - listEnvironments( - request: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): void; - listEnvironments( - request: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): void; - listEnvironments( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>, - callback?: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[], - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listEnvironments(request, options, callback); - } - -/** - * 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 - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment} 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 `listEnvironmentsAsync()` - * 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. - */ - listEnvironmentsStream( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEnvironments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEnvironments.createStream( - this.innerApiCalls.listEnvironments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEnvironments`, 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 - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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). - * When you iterate the returned iterable, each element will be an object representing - * [Environment]{@link google.cloud.orchestration.airflow.service.v1.Environment}. 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 include:samples/generated/v1/environments.list_environments.js - * region_tag:composer_v1_generated_Environments_ListEnvironments_async - */ - listEnvironmentsAsync( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListEnvironmentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEnvironments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEnvironments.asyncIterate( - this.innerApiCalls['listEnvironments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @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 - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @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 {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 {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @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)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @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)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified environment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} environment - * @returns {string} Resource name string. - */ - environmentPath(project:string,location:string,environment:string) { - return this.pathTemplates.environmentPathTemplate.render({ - project: project, - location: location, - environment: environment, - }); - } - - /** - * Parse the project from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).project; - } - - /** - * Parse the location from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).location; - } - - /** - * Parse the environment from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the environment. - */ - matchEnvironmentFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; - } - - /** - * 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 { - if (this.environmentsStub && !this._terminated) { - return this.environmentsStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json deleted file mode 100644 index 2f3d92af1f0..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "interfaces": { - "google.cloud.orchestration.airflow.service.v1.Environments": { - "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": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEnvironments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SaveSnapshot": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LoadSnapshot": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json deleted file mode 100644 index 674df9932cf..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/environments_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/orchestration/airflow/service/v1/environments.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1/operations.proto" -] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 0bb4722298e..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.orchestration.airflow.service.v1", - "libraryPackage": "@google-cloud/orchestration-airflow", - "services": { - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "GetEnvironment": { - "methods": [ - "getEnvironment" - ] - }, - "CreateEnvironment": { - "methods": [ - "createEnvironment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "updateEnvironment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "deleteEnvironment" - ] - }, - "SaveSnapshot": { - "methods": [ - "saveSnapshot" - ] - }, - "LoadSnapshot": { - "methods": [ - "loadSnapshot" - ] - }, - "ListEnvironments": { - "methods": [ - "listEnvironments", - "listEnvironmentsStream", - "listEnvironmentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "GetEnvironment": { - "methods": [ - "getEnvironment" - ] - }, - "CreateEnvironment": { - "methods": [ - "createEnvironment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "updateEnvironment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "deleteEnvironment" - ] - }, - "SaveSnapshot": { - "methods": [ - "saveSnapshot" - ] - }, - "LoadSnapshot": { - "methods": [ - "loadSnapshot" - ] - }, - "ListEnvironments": { - "methods": [ - "listEnvironments", - "listEnvironmentsStream", - "listEnvironmentsAsync" - ] - } - } - } - } - }, - "ImageVersions": { - "clients": { - "grpc": { - "libraryClient": "ImageVersionsClient", - "rpcs": { - "ListImageVersions": { - "methods": [ - "listImageVersions", - "listImageVersionsStream", - "listImageVersionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ImageVersionsClient", - "rpcs": { - "ListImageVersions": { - "methods": [ - "listImageVersions", - "listImageVersionsStream", - "listImageVersionsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts deleted file mode 100644 index cde3ada51ca..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client.ts +++ /dev/null @@ -1,557 +0,0 @@ -// 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 -// -// 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. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/image_versions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './image_versions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Readonly service to query available ImageVersions. - * @class - * @memberof v1 - */ -export class ImageVersionsClient { - 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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - imageVersionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ImageVersionsClient. - * - * @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/main/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] - * @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 {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @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}. - * @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 ImageVersionsClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ImageVersionsClient; - 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 = 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. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - 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 ? gaxInstance.fallback : gaxInstance; - - // 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. - this._opts = opts; - - // 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; - } - - // Determine the client header string. - 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/${this._gaxModule.version}`); - } - 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}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - environmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/environments/{environment}' - ), - }; - - // 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 = { - listImageVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'imageVersions') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.orchestration.airflow.service.v1.ImageVersions', 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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * 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.imageVersionsStub) { - return this.imageVersionsStub; - } - - // Put together the "service stub" for - // google.cloud.orchestration.airflow.service.v1.ImageVersions. - this.imageVersionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1.ImageVersions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.orchestration.airflow.service.v1.ImageVersions, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const imageVersionsStubMethods = - ['listImageVersions']; - for (const methodName of imageVersionsStubMethods) { - const callPromise = this.imageVersionsStub.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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.imageVersionsStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'composer.googleapis.com'; - } - - /** - * 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 'composer.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * List ImageVersions for provided location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion}. - * 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. - * Note that it can affect your quota. - * We recommend using `listImageVersionsAsync()` - * 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. - */ - listImageVersions( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[], - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse - ]>; - listImageVersions( - request: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): void; - listImageVersions( - request: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): void; - listImageVersions( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>, - callback?: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[], - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listImageVersions(request, options, callback); - } - -/** - * 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 - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion} 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 `listImageVersionsAsync()` - * 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. - */ - listImageVersionsStream( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listImageVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listImageVersions.createStream( - this.innerApiCalls.listImageVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listImageVersions`, 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 - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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). - * When you iterate the returned iterable, each element will be an object representing - * [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1.ImageVersion}. 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 include:samples/generated/v1/image_versions.list_image_versions.js - * region_tag:composer_v1_generated_ImageVersions_ListImageVersions_async - */ - listImageVersionsAsync( - request?: protos.google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listImageVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listImageVersions.asyncIterate( - this.innerApiCalls['listImageVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified environment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} environment - * @returns {string} Resource name string. - */ - environmentPath(project:string,location:string,environment:string) { - return this.pathTemplates.environmentPathTemplate.render({ - project: project, - location: location, - environment: environment, - }); - } - - /** - * Parse the project from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).project; - } - - /** - * Parse the location from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).location; - } - - /** - * Parse the environment from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the environment. - */ - matchEnvironmentFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; - } - - /** - * 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 { - if (this.imageVersionsStub && !this._terminated) { - return this.imageVersionsStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json deleted file mode 100644 index 6ae2b5fc9c6..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.orchestration.airflow.service.v1.ImageVersions": { - "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": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListImageVersions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json deleted file mode 100644 index 674df9932cf..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/image_versions_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/orchestration/airflow/service/v1/environments.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1/operations.proto" -] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts deleted file mode 100644 index 9a109a1d699..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/src/v1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// 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 -// -// 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 {EnvironmentsClient} from './environments_client'; -export {ImageVersionsClient} from './image_versions_client'; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 3d4b3363bc8..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// 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 -// -// 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 service = require('@google-cloud/orchestration-airflow'); - -function main() { - const environmentsClient = new service.EnvironmentsClient(); - const imageVersionsClient = new service.ImageVersionsClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 63551cdc1e7..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// 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 -// -// 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 {EnvironmentsClient, ImageVersionsClient} from '@google-cloud/orchestration-airflow'; - -// check that the client class type name can be used -function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { - client.close(); -} -function doStuffWithImageVersionsClient(client: ImageVersionsClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const environmentsClient = new EnvironmentsClient(); - doStuffWithEnvironmentsClient(environmentsClient); - // check that the client instance can be created - const imageVersionsClient = new ImageVersionsClient(); - doStuffWithImageVersionsClient(imageVersionsClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts deleted file mode 100644 index 557a57558e1..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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 -// -// 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'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts deleted file mode 100644 index 4986a5cb314..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_environments_v1.ts +++ /dev/null @@ -1,1640 +0,0 @@ -// 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 -// -// 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 environmentsModule from '../src'; - -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) - .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('v1.EnvironmentsClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = environmentsModule.v1.EnvironmentsClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = environmentsModule.v1.EnvironmentsClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = environmentsModule.v1.EnvironmentsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new environmentsModule.v1.EnvironmentsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.environmentsStub, undefined); - await client.initialize(); - assert(client.environmentsStub); - }); - - it('has close method for the initialized client', done => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.environmentsStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.environmentsStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new environmentsModule.v1.EnvironmentsClient({ - 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 environmentsModule.v1.EnvironmentsClient({ - 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('getEnvironment', () => { - it('invokes getEnvironment without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.Environment() - ); - client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); - const [response] = await client.getEnvironment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.Environment() - ); - client.innerApiCalls.getEnvironment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEnvironment( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEnvironment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment with closed client', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEnvironment(request), expectedError); - }); - }); - - describe('createEnvironment', () => { - it('invokes createEnvironment without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEnvironment( - 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); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment with call error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment with LRO error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkCreateEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkCreateEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateEnvironment', () => { - it('invokes updateEnvironment without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEnvironment( - 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); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment with call error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment with LRO error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkUpdateEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkUpdateEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEnvironment', () => { - it('invokes deleteEnvironment without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEnvironment( - 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); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment with call error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment with LRO error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkDeleteEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkDeleteEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('saveSnapshot', () => { - it('invokes saveSnapshot without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); - const [operation] = await client.saveSnapshot(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.saveSnapshot = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.saveSnapshot( - 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); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot with call error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.saveSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot with LRO error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.saveSnapshot(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSaveSnapshotProgress without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkSaveSnapshotProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSaveSnapshotProgress with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkSaveSnapshotProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('loadSnapshot', () => { - it('invokes loadSnapshot without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); - const [operation] = await client.loadSnapshot(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.loadSnapshot = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.loadSnapshot( - 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); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot with call error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.loadSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot with LRO error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.loadSnapshot(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkLoadSnapshotProgress without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkLoadSnapshotProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkLoadSnapshotProgress with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - 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.checkLoadSnapshotProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listEnvironments', () => { - it('invokes listEnvironments without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - ]; - client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); - const [response] = await client.listEnvironments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironments without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - ]; - client.innerApiCalls.listEnvironments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEnvironments( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironments with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEnvironments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEnvironments(request), expectedError); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironmentsStream without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - ]; - client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEnvironmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.Environment[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.Environment) => { - 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.listEnvironments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); - assert( - (client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEnvironmentsStream with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEnvironmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.Environment[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.Environment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); - assert( - (client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEnvironments without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.Environment()), - ]; - client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[] = []; - const iterable = client.listEnvironmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEnvironments with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEnvironmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.IEnvironment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('environment', () => { - const fakePath = "/rendered/path/environment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - environment: "environmentValue", - }; - const client = new environmentsModule.v1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.environmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.environmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('environmentPath', () => { - const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEnvironmentName', () => { - const result = client.matchProjectFromEnvironmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEnvironmentName', () => { - const result = client.matchLocationFromEnvironmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEnvironmentFromEnvironmentName', () => { - const result = client.matchEnvironmentFromEnvironmentName(fakePath); - assert.strictEqual(result, "environmentValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts deleted file mode 100644 index 74c06368f17..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/test/gapic_image_versions_v1.ts +++ /dev/null @@ -1,491 +0,0 @@ -// 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 -// -// 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 imageversionsModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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) - .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 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('v1.ImageVersionsClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = imageversionsModule.v1.ImageVersionsClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = imageversionsModule.v1.ImageVersionsClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = imageversionsModule.v1.ImageVersionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new imageversionsModule.v1.ImageVersionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.imageVersionsStub, undefined); - await client.initialize(); - assert(client.imageVersionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.imageVersionsStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.imageVersionsStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new imageversionsModule.v1.ImageVersionsClient({ - 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 imageversionsModule.v1.ImageVersionsClient({ - 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('listImageVersions', () => { - it('invokes listImageVersions without error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - ]; - client.innerApiCalls.listImageVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listImageVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersions without error using callback', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - ]; - client.innerApiCalls.listImageVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listImageVersions( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersions with error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listImageVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listImageVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersionsStream without error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - ]; - client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listImageVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion) => { - 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.listImageVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); - assert( - (client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listImageVersionsStream with error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listImageVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1.ImageVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); - assert( - (client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listImageVersions without error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1.ImageVersion()), - ]; - client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[] = []; - const iterable = client.listImageVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listImageVersions with error', async () => { - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listImageVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.orchestration.airflow.service.v1.IImageVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('environment', () => { - const fakePath = "/rendered/path/environment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - environment: "environmentValue", - }; - const client = new imageversionsModule.v1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.environmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.environmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('environmentPath', () => { - const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEnvironmentName', () => { - const result = client.matchProjectFromEnvironmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEnvironmentName', () => { - const result = client.matchLocationFromEnvironmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEnvironmentFromEnvironmentName', () => { - const result = client.matchEnvironmentFromEnvironmentName(fakePath); - assert.strictEqual(result, "environmentValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js deleted file mode 100644 index 9b7becac60a..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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 -// -// 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'Environments', - filename: './environments.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - 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/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js deleted file mode 100644 index 4eacd7d3697..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -// -// 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'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/orchestration-airflow', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js deleted file mode 100644 index 481c522b00f..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// 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 -// -// 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. ** - -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 diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js deleted file mode 100644 index 494e147865d..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// 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 -// -// 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md deleted file mode 100644 index 536af38a9bb..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Service: Nodejs Client diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c8633..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json deleted file mode 100644 index 05f03ef3726..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "@google-cloud/orchestration-airflow", - "version": "0.1.0", - "description": "Service client for Node.js", - "repository": "googleapis/nodejs-service", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google service", - "service", - "environments", - "image versions" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.62", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto deleted file mode 100644 index b2797ea7a41..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto +++ /dev/null @@ -1,1305 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1beta1; - -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/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; -option java_multiple_files = true; -option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; - -// Managed Apache Airflow Environments. -service Environments { - option (google.api.default_host) = "composer.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a new environment. - rpc CreateEnvironment(CreateEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/environments" - body: "environment" - }; - option (google.api.method_signature) = "parent,environment"; - option (google.longrunning.operation_info) = { - response_type: "Environment" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Get an existing environment. - rpc GetEnvironment(GetEnvironmentRequest) returns (Environment) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/environments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List environments. - rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/environments" - }; - option (google.api.method_signature) = "parent"; - } - - // Update an environment. - rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{name=projects/*/locations/*/environments/*}" - body: "environment" - }; - option (google.api.method_signature) = "name,environment,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Environment" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Delete an environment. - rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/environments/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Restart Airflow web server. - rpc RestartWebServer(RestartWebServerRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Environment" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Check if an upgrade operation on the environment will succeed. - // - // In case of problems detailed info can be found in the returned Operation. - rpc CheckUpgrade(CheckUpgradeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Creates a snapshots of a Cloud Composer environment. - // - // As a result of this operation, snapshot of environment's state is stored - // in a location specified in the SaveSnapshotRequest. - rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } - - // Loads a snapshot of a Cloud Composer environment. - // - // As a result of this operation, a snapshot of environment's specified in - // LoadSnapshotRequest is loaded into the environment. - rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse" - metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" - }; - } -} - -// Create a new environment. -message CreateEnvironmentRequest { - // The parent must be of the form - // "projects/{projectId}/locations/{locationId}". - string parent = 1; - - // The environment to create. - Environment environment = 2; -} - -// Get an environment. -message GetEnvironmentRequest { - // The resource name of the environment to get, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 1; -} - -// List environments in a project and location. -message ListEnvironmentsRequest { - // List environments in the given project and location, in the form: - // "projects/{projectId}/locations/{locationId}" - string parent = 1; - - // The maximum number of environments to return. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; -} - -// The environments in a project and location. -message ListEnvironmentsResponse { - // The list of environments returned by a ListEnvironmentsRequest. - repeated Environment environments = 1; - - // The page token used to query for the next page if one exists. - string next_page_token = 2; -} - -// Delete an environment. -message DeleteEnvironmentRequest { - // The environment to delete, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 1; -} - -// Update an environment. -message UpdateEnvironmentRequest { - // The relative resource name of the environment to update, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 2; - - // A patch environment. Fields specified by the `updateMask` will be copied - // from the patch environment into the environment under update. - Environment environment = 1; - - // Required. A comma-separated list of paths, relative to `Environment`, of - // fields to update. - // For example, to set the version of scikit-learn to install in the - // environment to 0.19.0 and to remove an existing installation of - // argparse, the `updateMask` parameter would include the following two - // `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - // "config.softwareConfig.pypiPackages.argparse". The included patch - // environment would specify the scikit-learn version as follows: - // - // { - // "config":{ - // "softwareConfig":{ - // "pypiPackages":{ - // "scikit-learn":"==0.19.0" - // } - // } - // } - // } - // - // Note that in the above example, any existing PyPI packages - // other than scikit-learn and argparse will be unaffected. - // - // Only one update type may be included in a single request's `updateMask`. - // For example, one cannot update both the PyPI packages and - // labels in the same request. However, it is possible to update multiple - // members of a map field simultaneously in the same request. For example, - // to set the labels "label1" and "label2" while clearing "label3" (assuming - // it already exists), one can - // provide the paths "labels.label1", "labels.label2", and "labels.label3" - // and populate the patch environment as follows: - // - // { - // "labels":{ - // "label1":"new-label1-value" - // "label2":"new-label2-value" - // } - // } - // - // Note that in the above example, any existing labels that are not - // included in the `updateMask` will be unaffected. - // - // It is also possible to replace an entire map field by providing the - // map field's path in the `updateMask`. The new value of the field will - // be that which is provided in the patch environment. For example, to - // delete all pre-existing user-specified PyPI packages and - // install botocore at version 1.7.14, the `updateMask` would contain - // the path "config.softwareConfig.pypiPackages", and - // the patch environment would be the following: - // - // { - // "config":{ - // "softwareConfig":{ - // "pypiPackages":{ - // "botocore":"==1.7.14" - // } - // } - // } - // } - // - // **Note:** Only the following fields can be updated: - // - // * `config.softwareConfig.pypiPackages` - // * Replace all custom custom PyPI packages. If a replacement - // package map is not included in `environment`, all custom - // PyPI packages are cleared. It is an error to provide both - // this mask and a mask specifying an individual package. - // * `config.softwareConfig.pypiPackages.`packagename - // * Update the custom PyPI package *packagename*, - // preserving other packages. To delete the package, include it in - // `updateMask`, and omit the mapping for it in - // `environment.config.softwareConfig.pypiPackages`. It is an error - // to provide both a mask of this form and the - // `config.softwareConfig.pypiPackages` mask. - // * `labels` - // * Replace all environment labels. If a replacement labels map is not - // included in `environment`, all labels are cleared. It is an error to - // provide both this mask and a mask specifying one or more individual - // labels. - // * `labels.`labelName - // * Set the label named *labelName*, while preserving other - // labels. To delete the label, include it in `updateMask` and omit its - // mapping in `environment.labels`. It is an error to provide both a - // mask of this form and the `labels` mask. - // * `config.nodeCount` - // * Horizontally scale the number of nodes in the environment. An integer - // greater than or equal to 3 must be provided in the `config.nodeCount` - // field. Supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - // * `config.webServerNetworkAccessControl` - // * Replace the environment's current WebServerNetworkAccessControl. - // * `config.softwareConfig.airflowConfigOverrides` - // * Replace all Apache Airflow config overrides. If a replacement config - // overrides map is not included in `environment`, all config overrides - // are cleared. - // It is an error to provide both this mask and a mask specifying one or - // more individual config overrides. - // * `config.softwareConfig.airflowConfigOverrides.`section-name - // * Override the Apache Airflow config property *name* in the - // section named *section*, preserving other properties. To - // delete the property override, include it in `updateMask` and omit its - // mapping in - // `environment.config.softwareConfig.airflowConfigOverrides`. - // It is an error to provide both a mask of this form and the - // `config.softwareConfig.airflowConfigOverrides` mask. - // * `config.softwareConfig.envVariables` - // * Replace all environment variables. If a replacement environment - // variable map is not included in `environment`, all custom environment - // variables are cleared. - // * `config.softwareConfig.imageVersion` - // * Upgrade the version of the environment in-place. Refer to - // `SoftwareConfig.image_version` for information on how to format the - // new image version. Additionally, the new image version cannot effect - // a version downgrade, and must match the current image version's - // Composer and Airflow major versions. Consult the [Cloud Composer - // version list](/composer/docs/concepts/versioning/composer-versions) - // for valid values. - // * `config.softwareConfig.schedulerCount` - // * Horizontally scale the number of schedulers in Airflow. A positive - // integer not greater than the number of nodes must be provided in the - // `config.softwareConfig.schedulerCount` field. Supported for Cloud - // Composer environments in versions composer-1.*.*-airflow-2.*.*. - // * `config.softwareConfig.cloudDataLineageIntegration` - // * Configuration for Cloud Data Lineage integration. - // * `config.databaseConfig.machineType` - // * Cloud SQL machine type used by Airflow database. - // It has to be one of: db-n1-standard-2, db-n1-standard-4, - // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - // environments in versions composer-1.*.*-airflow-*.*.*. - // * `config.webServerConfig.machineType` - // * Machine type on which Airflow web server is running. - // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - // or composer-n1-webserver-8. Supported for Cloud Composer environments - // in versions composer-1.*.*-airflow-*.*.*. - // * `config.maintenanceWindow` - // * Maintenance window during which Cloud Composer components may be - // under maintenance. - // * `config.workloadsConfig` - // * The workloads configuration settings for the GKE cluster associated - // with the Cloud Composer environment. Supported for Cloud Composer - // environments in versions composer-2.*.*-airflow-*.*.* and newer. - // * `config.environmentSize` - // * The size of the Cloud Composer environment. Supported for Cloud - // Composer environments in versions composer-2.*.*-airflow-*.*.* and - // newer. - google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Restart Airflow web server. -message RestartWebServerRequest { - // The resource name of the environment to restart the web server for, in the - // form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string name = 1; -} - -// Response to ExecuteAirflowCommandRequest. -message ExecuteAirflowCommandResponse { - // The unique ID of the command execution for polling. - string execution_id = 1; - - // The name of the pod where the command is executed. - string pod = 2; - - // The namespace of the pod where the command is executed. - string pod_namespace = 3; - - // Error message. Empty if there was no error. - string error = 4; -} - -// Response to PollAirflowCommandRequest. -message PollAirflowCommandResponse { - // Contains information about a single line from logs. - message Line { - // Number of the line. - int32 line_number = 1; - - // Text content of the log line. - string content = 2; - } - - // Information about how a command ended. - message ExitInfo { - // The exit code from the command execution. - int32 exit_code = 1; - - // Error message. Empty if there was no error. - string error = 2; - } - - // Output from the command execution. It may not contain the full output - // and the caller may need to poll for more lines. - repeated Line output = 1; - - // Whether the command execution has finished and there is no more output. - bool output_end = 2; - - // The result exit status of the command. - ExitInfo exit_info = 3; -} - -// Request to create a snapshot of a Cloud Composer environment. -message SaveSnapshotRequest { - // The resource name of the source environment in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string environment = 1; - - // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: - // "gs://my-bucket/snapshots". - string snapshot_location = 2; -} - -// Response to SaveSnapshotRequest. -message SaveSnapshotResponse { - // The fully-resolved Cloud Storage path of the created snapshot, - // e.g.: - // "gs://my-bucket/snapshots/project_location_environment_timestamp". - // This field is populated only if the snapshot creation was successful. - string snapshot_path = 1; -} - -// Request to load a snapshot into a Cloud Composer environment. -message LoadSnapshotRequest { - // The resource name of the target environment in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string environment = 1; - - // A Cloud Storage path to a snapshot to load, e.g.: - // "gs://my-bucket/snapshots/project_location_environment_timestamp". - string snapshot_path = 2; - - // Whether or not to skip installing Pypi packages when loading the - // environment's state. - bool skip_pypi_packages_installation = 3; - - // Whether or not to skip setting environment variables when loading the - // environment's state. - bool skip_environment_variables_setting = 4; - - // Whether or not to skip setting Airflow overrides when loading the - // environment's state. - bool skip_airflow_overrides_setting = 5; - - // Whether or not to skip copying Cloud Storage data when loading the - // environment's state. - bool skip_gcs_data_copying = 6; -} - -// Response to LoadSnapshotRequest. -message LoadSnapshotResponse { - -} - -// Configuration information for an environment. -message EnvironmentConfig { - // The size of the Cloud Composer environment. - enum EnvironmentSize { - // The size of the environment is unspecified. - ENVIRONMENT_SIZE_UNSPECIFIED = 0; - - // The environment size is small. - ENVIRONMENT_SIZE_SMALL = 1; - - // The environment size is medium. - ENVIRONMENT_SIZE_MEDIUM = 2; - - // The environment size is large. - ENVIRONMENT_SIZE_LARGE = 3; - } - - // Output only. The Kubernetes Engine cluster used to run this environment. - string gke_cluster = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The Cloud Storage prefix of the DAGs for this environment. Although Cloud - // Storage objects reside in a flat namespace, a hierarchical file tree - // can be simulated using "/"-delimited object name prefixes. DAG objects for - // this environment reside in a simulated directory with the given prefix. - string dag_gcs_prefix = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The number of nodes in the Kubernetes Engine cluster that will be - // used to run this environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - int32 node_count = 3; - - // The configuration settings for software inside the environment. - SoftwareConfig software_config = 4; - - // The configuration used for the Kubernetes Engine cluster. - NodeConfig node_config = 5; - - // The configuration used for the Private IP Cloud Composer environment. - PrivateEnvironmentConfig private_environment_config = 7; - - // Optional. The network-level access control policy for the Airflow web server. If - // unspecified, no network-level access restrictions will be applied. - WebServerNetworkAccessControl web_server_network_access_control = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration settings for Cloud SQL instance used internally by Apache - // Airflow software. - DatabaseConfig database_config = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration settings for the Airflow web server App Engine instance. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - WebServerConfig web_server_config = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see - // [Airflow web - // interface](/composer/docs/how-to/accessing/airflow-web-interface)). - string airflow_uri = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The encryption options for the Cloud Composer environment and its - // dependencies. Cannot be updated. - EncryptionConfig encryption_config = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maintenance window is the period when Cloud Composer components may - // undergo maintenance. It is defined so that maintenance is not executed - // during peak hours or critical time periods. - // - // The system will not be under maintenance for every occurrence of this - // window, but when maintenance is planned, it will be scheduled - // during the window. - // - // The maintenance window period must encompass at least 12 hours per week. - // This may be split into multiple chunks, each with a size of - // at least 4 hours. - // - // If this value is omitted, Cloud Composer components may be subject to - // maintenance at any time. - MaintenanceWindow maintenance_window = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The workloads configuration settings for the GKE cluster associated with - // the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web - // server and workers workloads. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - WorkloadsConfig workloads_config = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The size of the Cloud Composer environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration options for GKE cluster master authorized networks. - // By default master authorized networks feature is: - // - in case of private environment: enabled with no external networks - // allowlisted. - // - in case of public environment: disabled. - MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Recovery settings configuration of an environment. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; -} - -// Network-level access control policy for the Airflow web server. -message WebServerNetworkAccessControl { - // Allowed IP range with user-provided description. - message AllowedIpRange { - // IP address or range, defined using CIDR notation, of requests that this - // rule applies to. - // Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` - // or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. - // - // IP range prefixes should be properly truncated. For example, - // `1.2.3.4/24` should be truncated to `1.2.3.0/24`. Similarly, for IPv6, - // `2001:db8::1/32` should be truncated to `2001:db8::/32`. - string value = 1; - - // Optional. User-provided description. It must contain at most 300 characters. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // A collection of allowed IP ranges with descriptions. - repeated AllowedIpRange allowed_ip_ranges = 1; -} - -// Specifies the selection and configuration of software inside the environment. -message SoftwareConfig { - // The version of the software running in the environment. - // This encapsulates both the version of Cloud Composer functionality and the - // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. - // When used as input, the server also checks if the provided version is - // supported and denies the request for an unsupported version. - // - // The Cloud Composer portion of the image version is a full - // [semantic version](https://semver.org), or an alias in the form of major - // version number or `latest`. When an alias is provided, the server replaces - // it with the current Cloud Composer version that satisfies the alias. - // - // The Apache Airflow portion of the image version is a full semantic version - // that points to one of the supported Apache Airflow versions, or an alias in - // the form of only major or major.minor versions specified. When an alias is - // provided, the server replaces it with the latest Apache Airflow version - // that satisfies the alias and is supported in the given Cloud Composer - // version. - // - // In all cases, the resolved image version is stored in the same field. - // - // See also [version - // list](/composer/docs/concepts/versioning/composer-versions) and [versioning - // overview](/composer/docs/concepts/versioning/composer-versioning-overview). - string image_version = 1; - - // Optional. Apache Airflow configuration properties to override. - // - // Property keys contain the section and property names, separated by a - // hyphen, for example "core-dags_are_paused_at_creation". Section names must - // not contain hyphens ("-"), opening square brackets ("["), or closing - // square brackets ("]"). The property name must not be empty and must not - // contain an equals sign ("=") or semicolon (";"). Section and property names - // must not contain a period ("."). Apache Airflow configuration property - // names must be written in - // [snake_case](https://en.wikipedia.org/wiki/Snake_case). Property values can - // contain any character, and can be written in any lower/upper case format. - // - // Certain Apache Airflow configuration property values are - // [blocked](/composer/docs/concepts/airflow-configurations), - // and cannot be overridden. - map airflow_config_overrides = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Custom Python Package Index (PyPI) packages to be installed in - // the environment. - // - // Keys refer to the lowercase package name such as "numpy" - // and values are the lowercase extras and version specifier such as - // "==1.12.0", "[devel,gcp_api]", or "[devel]>=1.8.2, <1.9.2". To specify a - // package without pinning it to a version specifier, use the empty string as - // the value. - map pypi_packages = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Additional environment variables to provide to the Apache Airflow - // scheduler, worker, and webserver processes. - // - // Environment variable names must match the regular expression - // `[a-zA-Z_][a-zA-Z0-9_]*`. They cannot specify Apache Airflow - // software configuration overrides (they cannot match the regular expression - // `AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+`), and they cannot match any of the - // following reserved names: - // - // * `AIRFLOW_HOME` - // * `C_FORCE_ROOT` - // * `CONTAINER_NAME` - // * `DAGS_FOLDER` - // * `GCP_PROJECT` - // * `GCS_BUCKET` - // * `GKE_CLUSTER_NAME` - // * `SQL_DATABASE` - // * `SQL_INSTANCE` - // * `SQL_PASSWORD` - // * `SQL_PROJECT` - // * `SQL_REGION` - // * `SQL_USER` - map env_variables = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The major version of Python used to run the Apache Airflow - // scheduler, worker, and webserver processes. - // - // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be - // updated. - // - // This field is only supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use - // Python major version 3. - string python_version = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of schedulers for Airflow. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-2.*.*. - int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The configuration for Cloud Data Lineage integration. - CloudDataLineageIntegration cloud_data_lineage_integration = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for controlling how IPs are allocated in the -// GKE cluster. -message IPAllocationPolicy { - // Optional. Whether or not to enable Alias IPs in the GKE cluster. - // If `true`, a VPC-native cluster is created. - // - // This field is only supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use - // VPC-native GKE clusters. - bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the cluster's secondary range used to allocate - // IP addresses to pods. Specify either `cluster_secondary_range_name` - // or `cluster_ipv4_cidr_block` but not both. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the services' secondary range used to allocate - // IP addresses to the cluster. Specify either `services_secondary_range_name` - // or `services_ipv4_cidr_block` but not both. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The IP address range used to allocate IP addresses to pods in - // the cluster. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - // - // Set to blank to have GKE choose a range with the default size. - // - // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific - // netmask. - // - // Set to a - // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - // Specify `cluster_secondary_range_name` or `cluster_ipv4_cidr_block` - // but not both. - string cluster_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The IP address range of the services IP addresses in this - // cluster. - // - // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, - // this field is applicable only when `use_ip_aliases` is true. - // - // Set to blank to have GKE choose a range with the default size. - // - // Set to /netmask (e.g. `/14`) to have GKE choose a range with a specific - // netmask. - // - // Set to a - // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - // to use. - // Specify `services_secondary_range_name` or `services_ipv4_cidr_block` - // but not both. - string services_ipv4_cidr_block = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration information for the Kubernetes Engine nodes running -// the Apache Airflow software. -message NodeConfig { - // Optional. The Compute Engine [zone](/compute/docs/regions-zones) in which - // to deploy the VMs used to run the Apache Airflow software, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/zones/{zoneId}". - // - // This `location` must belong to the enclosing environment's project and - // location. If both this field and `nodeConfig.machineType` are specified, - // `nodeConfig.machineType` must belong to this `location`; if both are - // unspecified, the service will pick a zone in the Compute Engine region - // corresponding to the Cloud Composer location, and propagate that choice to - // both fields. If only one field (`location` or `nodeConfig.machineType`) is - // specified, the location information from the specified field will be - // propagated to the unspecified field. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string location = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine - // [machine type](/compute/docs/machine-types) used for cluster instances, - // specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/zones/{zoneId}/machineTypes/{machineTypeId}". - // - // The `machineType` must belong to the enclosing environment's project and - // location. If both this field and `nodeConfig.location` are specified, - // this `machineType` must belong to the `nodeConfig.location`; if both are - // unspecified, the service will pick a zone in the Compute Engine region - // corresponding to the Cloud Composer location, and propagate that choice to - // both fields. If exactly one of this field and `nodeConfig.location` is - // specified, the location information from the specified field will be - // propagated to the unspecified field. - // - // The `machineTypeId` must not be a [shared-core machine - // type](/compute/docs/machine-types#sharedcore). - // - // If this field is unspecified, the `machineTypeId` defaults - // to "n1-standard-1". - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string machine_type = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine network to be used for machine - // communications, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/global/networks/{networkId}". - // - // If unspecified, the default network in the environment's project is used. - // If a [Custom Subnet Network](/vpc/docs/vpc#vpc_networks_and_subnets) - // is provided, `nodeConfig.subnetwork` must also be provided. For - // [Shared VPC](/vpc/docs/shared-vpc) subnetwork requirements, see - // `nodeConfig.subnetwork`. - string network = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine subnetwork to be used for machine - // communications, specified as a - // [relative resource - // name](/apis/design/resource_names#relative_resource_name). For example: - // "projects/{projectId}/regions/{regionId}/subnetworks/{subnetworkId}" - // - // If a subnetwork is provided, `nodeConfig.network` must also be provided, - // and the subnetwork must belong to the enclosing environment's project and - // location. - string subnetwork = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. - // If unspecified, defaults to 100GB. Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - int32 disk_size_gb = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The set of Google API scopes to be made available on all - // node VMs. If `oauth_scopes` is empty, defaults to - // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - repeated string oauth_scopes = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Google Cloud Platform Service Account to be used by the workloads. If a - // service account is not specified, the "default" Compute Engine service - // account is used. Cannot be updated. - string service_account = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of instance tags applied to all node VMs. Tags are used - // to identify valid sources or targets for network firewalls. Each tag within - // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - // Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The IPAllocationPolicy fields for the GKE cluster. - IPAllocationPolicy ip_allocation_policy = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The maximum number of pods per node in the Cloud Composer GKE cluster. - // The value must be between 8 and 110 and it can be set only if - // the environment is VPC-native. - // The default value is 32. Values of this field will be propagated both to - // the `default-pool` node pool of the newly created GKE cluster, and to the - // default "Maximum Pods per Node" value which is used for newly created - // node pools if their value is not explicitly set during node pool creation. - // For more information, see [Optimizing IP address allocation] - // (https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr). - // Cannot be updated. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - int32 max_pods_per_node = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines - // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for - // all destination addresses, except between pods traffic. - // - // See: - // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent - bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration options for the private GKE cluster in a Cloud Composer -// environment. -message PrivateClusterConfig { - // Optional. If `true`, access to the public endpoint of the GKE cluster is - // denied. - bool enable_private_endpoint = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IPv4 range for GKE master will be reserved. If - // left blank, the default value of '172.16.0.0/23' is used. - string master_ipv4_cidr_block = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range in CIDR notation to use for the hosted master network. This - // range is used for assigning internal IP addresses to the cluster - // master or set of masters and to the internal load balancer virtual IP. - // This range must not overlap with any other ranges in use - // within the cluster's network. - string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Configuration options for networking connections in the Composer 2 -// environment. -message NetworkingConfig { - // Represents connection type between Composer environment in Customer - // Project and the corresponding Tenant project, from a predefined list - // of available connection modes. - enum ConnectionType { - // No specific connection type was requested, so the environment uses - // the default value corresponding to the rest of its configuration. - CONNECTION_TYPE_UNSPECIFIED = 0; - - // Requests the use of VPC peerings for connecting the Customer and Tenant - // projects. - VPC_PEERING = 1; - - // Requests the use of Private Service Connect for connecting the Customer - // and Tenant projects. - PRIVATE_SERVICE_CONNECT = 2; - } - - // Optional. Indicates the user requested specifc connection type between Tenant and - // Customer projects. - // You cannot set networking connection type in public IP environment. - ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration information for configuring a Private IP Cloud Composer -// environment. -message PrivateEnvironmentConfig { - // Optional. If `true`, a Private IP Cloud Composer environment is created. - // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be - // set to true for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for the private GKE cluster for a Private IP - // Cloud Composer environment. - PrivateClusterConfig private_cluster_config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IP range for web server will be reserved. Needs - // to be disjoint from private_cluster_config.master_ipv4_cidr_block and - // cloud_sql_ipv4_cidr_block. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR block from which IP range in tenant project will be reserved for - // Cloud SQL. Needs to be disjoint from web_server_ipv4_cidr_block - string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range reserved for the tenant project's App Engine VMs. - // - // This field is supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant - // project will be reserved. Needs to be disjoint from - // private_cluster_config.master_ipv4_cidr_block and - // cloud_sql_ipv4_cidr_block. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - string cloud_composer_network_ipv4_cidr_block = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The IP range reserved for the tenant project's Cloud Composer network. - // - // This field is supported for Cloud Composer environments in versions - // composer-2.*.*-airflow-*.*.* and newer. - string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for - // `IPAllocationPolicy.cluster_ipv4_cidr_block` and - // `IPAllocationPolicy.service_ipv4_cidr_block`. - bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. When specified, the environment will use Private Service Connect - // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, - // and the PSC endpoint in the Customer Project will use an IP address from - // this subnetwork. - string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration for the network connections configuration in the environment. - NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration of Cloud SQL instance that is used by the Apache Airflow -// software. -message DatabaseConfig { - // Optional. Cloud SQL machine type used by Airflow database. - // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 - // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. - // Supported for Cloud Composer environments in versions - // composer-1.*.*-airflow-*.*.*. - string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration settings for the Airflow web server App Engine instance. -// Supported for Cloud Composer environments in versions -// composer-1.*.*-airflow-*.*.*. -message WebServerConfig { - // Optional. Machine type on which Airflow web server is running. - // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or - // composer-n1-webserver-8. - // If not specified, composer-n1-webserver-2 will be used. - // Value custom is returned only in response, if Airflow web server parameters - // were manually changed to a non-standard values. - string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The encryption options for the Cloud Composer environment and its -// dependencies. Supported for Cloud Composer environments in versions -// composer-1.*.*-airflow-*.*.*. -message EncryptionConfig { - // Optional. Customer-managed Encryption Key available through Google's Key Management - // Service. Cannot be updated. - // If not specified, Google-managed key will be used. - string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration settings for Cloud Composer maintenance window. -// The following example: -// -// ``` -// { -// "startTime":"2019-08-01T01:00:00Z" -// "endTime":"2019-08-01T07:00:00Z" -// "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE" -// } -// ``` -// -// would define a maintenance window between 01 and 07 hours UTC during -// each Tuesday and Wednesday. -message MaintenanceWindow { - // Required. Start time of the first recurrence of the maintenance window. - google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Maintenance window end time. It is used only to calculate the duration of - // the maintenance window. - // The value for end_time must be in the future, relative to `start_time`. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Maintenance window recurrence. Format is a subset of - // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed - // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...` - // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`. - string recurrence = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The Kubernetes workloads configuration for GKE cluster associated with the -// Cloud Composer environment. Supported for Cloud Composer environments in -// versions composer-2.*.*-airflow-*.*.* and newer. -message WorkloadsConfig { - // Configuration for resources used by Airflow schedulers. - message SchedulerResource { - // Optional. CPU request and limit for a single Airflow scheduler replica. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for a single Airflow scheduler replica. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for a single Airflow scheduler replica. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of schedulers. - int32 count = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for resources used by Airflow web server. - message WebServerResource { - // Optional. CPU request and limit for Airflow web server. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for Airflow web server. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for Airflow web server. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for resources used by Airflow workers. - message WorkerResource { - // Optional. CPU request and limit for a single Airflow worker replica. - float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for a single Airflow worker replica. - float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Storage (GB) request and limit for a single Airflow worker replica. - float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum number of workers for autoscaling. - int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of workers for autoscaling. - int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Configuration for resources used by Airflow triggerers. - message TriggererResource { - // Optional. The number of triggerers. - int32 count = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. CPU request and limit for a single Airflow triggerer replica. - float cpu = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Memory (GB) request and limit for a single Airflow triggerer replica. - float memory_gb = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Resources used by Airflow schedulers. - SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resources used by Airflow web server. - WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resources used by Airflow workers. - WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resources used by Airflow triggerers. - TriggererResource triggerer = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The Recovery settings of an environment. -message RecoveryConfig { - // Optional. The configuration for scheduled snapshot creation mechanism. - ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration for scheduled snapshot creation mechanism. -message ScheduledSnapshotsConfig { - // Optional. Whether scheduled snapshots creation is enabled. - bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage location for storing automatically created snapshots. - string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The cron expression representing the time when snapshots creation mechanism - // runs. This field is subject to additional validation around frequency of - // execution. - string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. - string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration options for the master authorized networks feature. Enabled -// master authorized networks will disallow all external traffic to access -// Kubernetes master through HTTPS except traffic from the given CIDR blocks, -// Google Compute Engine Public IPs and Google Prod IPs. -message MasterAuthorizedNetworksConfig { - // CIDR block with an optional name. - message CidrBlock { - // User-defined name that identifies the CIDR block. - string display_name = 1; - - // CIDR block that must be specified in CIDR notation. - string cidr_block = 2; - } - - // Whether or not master authorized networks feature is enabled. - bool enabled = 1; - - // Up to 50 external networks that could access Kubernetes master through - // HTTPS. - repeated CidrBlock cidr_blocks = 2; -} - -// Configuration for Cloud Data Lineage integration. -message CloudDataLineageIntegration { - // Optional. Whether or not Cloud Data Lineage integration is enabled. - bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// An environment for running orchestration tasks. -message Environment { - option (google.api.resource) = { - type: "composer.googleapis.com/Environment" - pattern: "projects/{project}/locations/{location}/environments/{environment}" - }; - - // State of the environment. - enum State { - // The state of the environment is unknown. - STATE_UNSPECIFIED = 0; - - // The environment is in the process of being created. - CREATING = 1; - - // The environment is currently running and healthy. It is ready for use. - RUNNING = 2; - - // The environment is being updated. It remains usable but cannot receive - // additional update requests or be deleted at this time. - UPDATING = 3; - - // The environment is undergoing deletion. It cannot be used. - DELETING = 4; - - // The environment has encountered an error and cannot be used. - ERROR = 5; - } - - // The resource name of the environment, in the form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - // - // EnvironmentId must start with a lowercase letter followed by up to 63 - // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - string name = 1; - - // Configuration parameters for this environment. - EnvironmentConfig config = 2; - - // Output only. The UUID (Universally Unique IDentifier) associated with this environment. - // This value is generated when the environment is created. - string uuid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The current state of the environment. - State state = 4; - - // Output only. The time at which this environment was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time at which this environment was last modified. - google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. User-defined labels for this environment. - // The labels map can contain no more than 64 entries. Entries of the labels - // map are UTF8 strings that comply with the following restrictions: - // - // * Keys must conform to regexp: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} - // * Values must conform to regexp: [\p{Ll}\p{Lo}\p{N}_-]{0,63} - // * Both keys and values are additionally constrained to be <= 128 bytes in - // size. - map labels = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request to check whether image upgrade will succeed. -message CheckUpgradeRequest { - // The resource name of the environment to check upgrade for, in the - // form: - // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - string environment = 1; - - // The version of the software running in the environment. - // This encapsulates both the version of Cloud Composer functionality and the - // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. - // When used as input, the server also checks if the provided version is - // supported and denies the request for an unsupported version. - // - // The Cloud Composer portion of the image version is a full - // [semantic version](https://semver.org), or an alias in the form of major - // version number or `latest`. When an alias is provided, the server replaces - // it with the current Cloud Composer version that satisfies the alias. - // - // The Apache Airflow portion of the image version is a full semantic version - // that points to one of the supported Apache Airflow versions, or an alias in - // the form of only major or major.minor versions specified. When an alias is - // provided, the server replaces it with the latest Apache Airflow version - // that satisfies the alias and is supported in the given Cloud Composer - // version. - // - // In all cases, the resolved image version is stored in the same field. - // - // See also [version - // list](/composer/docs/concepts/versioning/composer-versions) and [versioning - // overview](/composer/docs/concepts/versioning/composer-versioning-overview). - string image_version = 2; -} - -// Message containing information about the result of an upgrade check -// operation. -message CheckUpgradeResponse { - // Whether there were python modules conflict during image build. - enum ConflictResult { - // It is unknown whether build had conflicts or not. - CONFLICT_RESULT_UNSPECIFIED = 0; - - // There were python packages conflicts. - CONFLICT = 1; - - // There were no python packages conflicts. - NO_CONFLICT = 2; - } - - // Output only. Url for a docker build log of an upgraded image. - string build_log_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Whether build has succeeded or failed on modules conflicts. - ConflictResult contains_pypi_modules_conflict = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Extract from a docker image build log containing information about pypi - // modules conflicts. - string pypi_conflict_build_log_extract = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Composer image for which the build was happening. - string image_version = 5; - - // Pypi dependencies specified in the environment configuration, at the time - // when the build was triggered. - map pypi_dependencies = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto deleted file mode 100644 index 08bc9f0f587..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto +++ /dev/null @@ -1,88 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/type/date.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; -option java_multiple_files = true; -option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; - -// Readonly service to query available ImageVersions. -service ImageVersions { - option (google.api.default_host) = "composer.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // List ImageVersions for provided location. - rpc ListImageVersions(ListImageVersionsRequest) returns (ListImageVersionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/imageVersions" - }; - option (google.api.method_signature) = "parent"; - } -} - -// List ImageVersions in a project and location. -message ListImageVersionsRequest { - // List ImageVersions in the given project and location, in the form: - // "projects/{projectId}/locations/{locationId}" - string parent = 1; - - // The maximum number of image_versions to return. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 3; - - // Whether or not image versions from old releases should be included. - bool include_past_releases = 4; -} - -// The ImageVersions in a project and location. -message ListImageVersionsResponse { - // The list of supported ImageVersions in a location. - repeated ImageVersion image_versions = 1; - - // The page token used to query for the next page if one exists. - string next_page_token = 2; -} - -// Image Version information -message ImageVersion { - // The string identifier of the ImageVersion, in the form: - // "composer-x.y.z-airflow-a.b.c" - string image_version_id = 1; - - // Whether this is the default ImageVersion used by Composer during - // environment creation if no input ImageVersion is specified. - bool is_default = 2; - - // supported python versions - repeated string supported_python_versions = 3; - - // The date of the version release. - google.type.Date release_date = 4; - - // Whether it is impossible to create an environment with the image version. - bool creation_disabled = 5; - - // Whether it is impossible to upgrade an environment running with the image - // version. - bool upgrade_disabled = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto deleted file mode 100644 index 5ba18a52299..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto +++ /dev/null @@ -1,89 +0,0 @@ -// 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 -// -// 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.orchestration.airflow.service.v1beta1; - -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/orchestration/airflow/service/v1beta1;service"; -option java_multiple_files = true; -option java_outer_classname = "OperationsProto"; -option java_package = "com.google.cloud.orchestration.airflow.service.v1beta1"; - -// Metadata describing an operation. -message OperationMetadata { - // An enum describing the overall state of an operation. - enum State { - // Unused. - STATE_UNSPECIFIED = 0; - - // The operation has been created but is not yet started. - PENDING = 1; - - // The operation is underway. - RUNNING = 2; - - // The operation completed successfully. - SUCCESSFUL = 3; - - // The operation is no longer running but did not succeed. - FAILED = 4; - } - - // Type of longrunning operation. - enum Type { - // Unused. - TYPE_UNSPECIFIED = 0; - - // A resource creation operation. - CREATE = 1; - - // A resource deletion operation. - DELETE = 2; - - // A resource update operation. - UPDATE = 3; - - // A resource check operation. - CHECK = 4; - - // Saves snapshot of the resource operation. - SAVE_SNAPSHOT = 5; - - // Loads snapshot of the resource operation. - LOAD_SNAPSHOT = 6; - } - - // Output only. The current operation state. - State state = 1; - - // Output only. The type of operation being performed. - Type operation_type = 2; - - // Output only. The resource being operated on, as a [relative resource name]( - // /apis/design/resource_names#relative_resource_name). - string resource = 3; - - // Output only. The UUID of the resource being operated on. - string resource_uuid = 4; - - // Output only. The time the operation was submitted to the server. - google.protobuf.Timestamp create_time = 5; - - // Output only. The time when the operation terminated, regardless of its success. - // This field is unset if the operation is still ongoing. - google.protobuf.Timestamp end_time = 6; -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js deleted file mode 100644 index 53775ee99d7..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.check_upgrade.js +++ /dev/null @@ -1,86 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_CheckUpgrade_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. - */ - /** - * The resource name of the environment to check upgrade for, in the - * form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const environment = 'abc123' - /** - * The version of the software running in the environment. - * This encapsulates both the version of Cloud Composer functionality and the - * version of Apache Airflow. It must match the regular expression - * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. - * When used as input, the server also checks if the provided version is - * supported and denies the request for an unsupported version. - * The Cloud Composer portion of the image version is a full - * semantic version (https://semver.org), or an alias in the form of major - * version number or `latest`. When an alias is provided, the server replaces - * it with the current Cloud Composer version that satisfies the alias. - * The Apache Airflow portion of the image version is a full semantic version - * that points to one of the supported Apache Airflow versions, or an alias in - * the form of only major or major.minor versions specified. When an alias is - * provided, the server replaces it with the latest Apache Airflow version - * that satisfies the alias and is supported in the given Cloud Composer - * version. - * In all cases, the resolved image version is stored in the same field. - * See also version - * list (/composer/docs/concepts/versioning/composer-versions) and versioning - * overview (/composer/docs/concepts/versioning/composer-versioning-overview). - */ - // const imageVersion = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callCheckUpgrade() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.checkUpgrade(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCheckUpgrade(); - // [END composer_v1beta1_generated_Environments_CheckUpgrade_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js deleted file mode 100644 index 914230cd8da..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.create_environment.js +++ /dev/null @@ -1,66 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_CreateEnvironment_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. - */ - /** - * The parent must be of the form - * "projects/{projectId}/locations/{locationId}". - */ - // const parent = 'abc123' - /** - * The environment to create. - */ - // const environment = {} - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callCreateEnvironment() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.createEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateEnvironment(); - // [END composer_v1beta1_generated_Environments_CreateEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js deleted file mode 100644 index 53a3ec8a1e4..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.delete_environment.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_DeleteEnvironment_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. - */ - /** - * The environment to delete, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callDeleteEnvironment() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.deleteEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteEnvironment(); - // [END composer_v1beta1_generated_Environments_DeleteEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js deleted file mode 100644 index 24507c3803b..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.get_environment.js +++ /dev/null @@ -1,61 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_GetEnvironment_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. - */ - /** - * The resource name of the environment to get, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callGetEnvironment() { - // Construct request - const request = { - }; - - // Run request - const response = await serviceClient.getEnvironment(request); - console.log(response); - } - - callGetEnvironment(); - // [END composer_v1beta1_generated_Environments_GetEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js deleted file mode 100644 index cf9ae5d160f..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.list_environments.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_ListEnvironments_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. - */ - /** - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - */ - // const parent = 'abc123' - /** - * The maximum number of environments to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callListEnvironments() { - // Construct request - const request = { - }; - - // Run request - const iterable = await serviceClient.listEnvironmentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEnvironments(); - // [END composer_v1beta1_generated_Environments_ListEnvironments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js deleted file mode 100644 index dc26ccf4c01..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.restart_web_server.js +++ /dev/null @@ -1,63 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_Environments_RestartWebServer_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. - */ - /** - * The resource name of the environment to restart the web server for, in the - * form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callRestartWebServer() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await serviceClient.restartWebServer(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestartWebServer(); - // [END composer_v1beta1_generated_Environments_RestartWebServer_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js deleted file mode 100644 index 9ce9ee97029..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.update_environment.js +++ /dev/null @@ -1,206 +0,0 @@ -// 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 -// -// 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'; - -function main(updateMask) { - // [START composer_v1beta1_generated_Environments_UpdateEnvironment_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. - */ - /** - * The relative resource name of the environment to update, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - */ - // const name = 'abc123' - /** - * A patch environment. Fields specified by the `updateMask` will be copied - * from the patch environment into the environment under update. - */ - // const environment = {} - /** - * Required. A comma-separated list of paths, relative to `Environment`, of - * fields to update. - * For example, to set the version of scikit-learn to install in the - * environment to 0.19.0 and to remove an existing installation of - * argparse, the `updateMask` parameter would include the following two - * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - * "config.softwareConfig.pypiPackages.argparse". The included patch - * environment would specify the scikit-learn version as follows: - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "scikit-learn":"==0.19.0" - * } - * } - * } - * } - * Note that in the above example, any existing PyPI packages - * other than scikit-learn and argparse will be unaffected. - * Only one update type may be included in a single request's `updateMask`. - * For example, one cannot update both the PyPI packages and - * labels in the same request. However, it is possible to update multiple - * members of a map field simultaneously in the same request. For example, - * to set the labels "label1" and "label2" while clearing "label3" (assuming - * it already exists), one can - * provide the paths "labels.label1", "labels.label2", and "labels.label3" - * and populate the patch environment as follows: - * { - * "labels":{ - * "label1":"new-label1-value" - * "label2":"new-label2-value" - * } - * } - * Note that in the above example, any existing labels that are not - * included in the `updateMask` will be unaffected. - * It is also possible to replace an entire map field by providing the - * map field's path in the `updateMask`. The new value of the field will - * be that which is provided in the patch environment. For example, to - * delete all pre-existing user-specified PyPI packages and - * install botocore at version 1.7.14, the `updateMask` would contain - * the path "config.softwareConfig.pypiPackages", and - * the patch environment would be the following: - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "botocore":"==1.7.14" - * } - * } - * } - * } - * **Note:** Only the following fields can be updated: - * * `config.softwareConfig.pypiPackages` - * * Replace all custom custom PyPI packages. If a replacement - * package map is not included in `environment`, all custom - * PyPI packages are cleared. It is an error to provide both - * this mask and a mask specifying an individual package. - * * `config.softwareConfig.pypiPackages.`packagename - * * Update the custom PyPI package *packagename*, - * preserving other packages. To delete the package, include it in - * `updateMask`, and omit the mapping for it in - * `environment.config.softwareConfig.pypiPackages`. It is an error - * to provide both a mask of this form and the - * `config.softwareConfig.pypiPackages` mask. - * * `labels` - * * Replace all environment labels. If a replacement labels map is not - * included in `environment`, all labels are cleared. It is an error to - * provide both this mask and a mask specifying one or more individual - * labels. - * * `labels.`labelName - * * Set the label named *labelName*, while preserving other - * labels. To delete the label, include it in `updateMask` and omit its - * mapping in `environment.labels`. It is an error to provide both a - * mask of this form and the `labels` mask. - * * `config.nodeCount` - * * Horizontally scale the number of nodes in the environment. An integer - * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. Supported for Cloud Composer environments in versions - * composer-1.*.*-airflow-*.*.*. - * * `config.webServerNetworkAccessControl` - * * Replace the environment's current WebServerNetworkAccessControl. - * * `config.softwareConfig.airflowConfigOverrides` - * * Replace all Apache Airflow config overrides. If a replacement config - * overrides map is not included in `environment`, all config overrides - * are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual config overrides. - * * `config.softwareConfig.airflowConfigOverrides.`section-name - * * Override the Apache Airflow config property *name* in the - * section named *section*, preserving other properties. To - * delete the property override, include it in `updateMask` and omit its - * mapping in - * `environment.config.softwareConfig.airflowConfigOverrides`. - * It is an error to provide both a mask of this form and the - * `config.softwareConfig.airflowConfigOverrides` mask. - * * `config.softwareConfig.envVariables` - * * Replace all environment variables. If a replacement environment - * variable map is not included in `environment`, all custom environment - * variables are cleared. - * * `config.softwareConfig.imageVersion` - * * Upgrade the version of the environment in-place. Refer to - * `SoftwareConfig.image_version` for information on how to format the - * new image version. Additionally, the new image version cannot effect - * a version downgrade, and must match the current image version's - * Composer and Airflow major versions. Consult the Cloud Composer - * version list (/composer/docs/concepts/versioning/composer-versions) - * for valid values. - * * `config.softwareConfig.schedulerCount` - * * Horizontally scale the number of schedulers in Airflow. A positive - * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. Supported for Cloud - * Composer environments in versions composer-1.*.*-airflow-2.*.*. - * * `config.softwareConfig.cloudDataLineageIntegration` - * * Configuration for Cloud Data Lineage integration. - * * `config.databaseConfig.machineType` - * * Cloud SQL machine type used by Airflow database. - * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - * environments in versions composer-1.*.*-airflow-*.*.*. - * * `config.webServerConfig.machineType` - * * Machine type on which Airflow web server is running. - * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. Supported for Cloud Composer environments - * in versions composer-1.*.*-airflow-*.*.*. - * * `config.maintenanceWindow` - * * Maintenance window during which Cloud Composer components may be - * under maintenance. - * * `config.workloadsConfig` - * * The workloads configuration settings for the GKE cluster associated - * with the Cloud Composer environment. Supported for Cloud Composer - * environments in versions composer-2.*.*-airflow-*.*.* and newer. - * * `config.environmentSize` - * * The size of the Cloud Composer environment. Supported for Cloud - * Composer environments in versions composer-2.*.*-airflow-*.*.* and - * newer. - */ - // const updateMask = {} - - // Imports the Service library - const {EnvironmentsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new EnvironmentsClient(); - - async function callUpdateEnvironment() { - // Construct request - const request = { - updateMask, - }; - - // Run request - const [operation] = await serviceClient.updateEnvironment(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateEnvironment(); - // [END composer_v1beta1_generated_Environments_UpdateEnvironment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js deleted file mode 100644 index ca3b5cb3208..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/image_versions.list_image_versions.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 -// -// 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'; - -function main() { - // [START composer_v1beta1_generated_ImageVersions_ListImageVersions_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. - */ - /** - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - */ - // const parent = 'abc123' - /** - * The maximum number of image_versions to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value returned from a previous List request, if any. - */ - // const pageToken = 'abc123' - /** - * Whether or not image versions from old releases should be included. - */ - // const includePastReleases = true - - // Imports the Service library - const {ImageVersionsClient} = require('@google-cloud/orchestration-airflow').v1beta1; - - // Instantiates a client - const serviceClient = new ImageVersionsClient(); - - async function callListImageVersions() { - // Construct request - const request = { - }; - - // Run request - const iterable = await serviceClient.listImageVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListImageVersions(); - // [END composer_v1beta1_generated_ImageVersions_ListImageVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json deleted file mode 100644 index 590058c1a97..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-service", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.orchestration.airflow.service.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "composer_v1beta1_generated_Environments_CreateEnvironment_async", - "title": "Environments createEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Create a new environment.", - "canonical": true, - "file": "environments.create_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "environment", - "type": ".google.cloud.orchestration.airflow.service.v1beta1.Environment" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "CreateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_GetEnvironment_async", - "title": "Environments getEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Get an existing environment.", - "canonical": true, - "file": "environments.get_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.Environment", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "GetEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_ListEnvironments_async", - "title": "Environments listEnvironments Sample", - "origin": "API_DEFINITION", - "description": " List environments.", - "canonical": true, - "file": "environments.list_environments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEnvironments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "ListEnvironments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironments", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_UpdateEnvironment_async", - "title": "Environments updateEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Update an environment.", - "canonical": true, - "file": "environments.update_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 198, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "environment", - "type": ".google.cloud.orchestration.airflow.service.v1beta1.Environment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "UpdateEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_DeleteEnvironment_async", - "title": "Environments deleteEnvironment Sample", - "origin": "API_DEFINITION", - "description": " Delete an environment.", - "canonical": true, - "file": "environments.delete_environment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "DeleteEnvironment", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironment", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_RestartWebServer_async", - "title": "Environments restartWebServer Sample", - "origin": "API_DEFINITION", - "description": " Restart Airflow web server.", - "canonical": true, - "file": "environments.restart_web_server.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartWebServer", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServer", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "RestartWebServer", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServer", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_CheckUpgrade_async", - "title": "Environments checkUpgrade Sample", - "origin": "API_DEFINITION", - "description": " Check if an upgrade operation on the environment will succeed. In case of problems detailed info can be found in the returned Operation.", - "canonical": true, - "file": "environments.check_upgrade.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckUpgrade", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgrade", - "async": true, - "parameters": [ - { - "name": "environment", - "type": "TYPE_STRING" - }, - { - "name": "image_version", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "CheckUpgrade", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgrade", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_SaveSnapshot_async", - "title": "Environments saveSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", - "canonical": true, - "file": "environments.save_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SaveSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", - "async": true, - "parameters": [ - { - "name": "environment", - "type": "TYPE_STRING" - }, - { - "name": "snapshot_location", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "SaveSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_Environments_LoadSnapshot_async", - "title": "Environments loadSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", - "canonical": true, - "file": "environments.load_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LoadSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", - "async": true, - "parameters": [ - { - "name": "environment", - "type": "TYPE_STRING" - }, - { - "name": "snapshot_path", - "type": "TYPE_STRING" - }, - { - "name": "skip_pypi_packages_installation", - "type": "TYPE_BOOL" - }, - { - "name": "skip_environment_variables_setting", - "type": "TYPE_BOOL" - }, - { - "name": "skip_airflow_overrides_setting", - "type": "TYPE_BOOL" - }, - { - "name": "skip_gcs_data_copying", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "EnvironmentsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" - }, - "method": { - "shortName": "LoadSnapshot", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", - "service": { - "shortName": "Environments", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" - } - } - } - }, - { - "regionTag": "composer_v1beta1_generated_ImageVersions_ListImageVersions_async", - "title": "Environments listImageVersions Sample", - "origin": "API_DEFINITION", - "description": " List ImageVersions for provided location.", - "canonical": true, - "file": "image_versions.list_image_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions.ListImageVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "include_past_releases", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsResponse", - "client": { - "shortName": "ImageVersionsClient", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersionsClient" - }, - "method": { - "shortName": "ListImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions.ListImageVersions", - "service": { - "shortName": "ImageVersions", - "fullName": "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts deleted file mode 100644 index 6e03957497c..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// 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 -// -// 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 v1beta1 from './v1beta1'; -const EnvironmentsClient = v1beta1.EnvironmentsClient; -type EnvironmentsClient = v1beta1.EnvironmentsClient; -const ImageVersionsClient = v1beta1.ImageVersionsClient; -type ImageVersionsClient = v1beta1.ImageVersionsClient; -export {v1beta1, EnvironmentsClient, ImageVersionsClient}; -export default {v1beta1, EnvironmentsClient, ImageVersionsClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts deleted file mode 100644 index f60a5c33efe..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client.ts +++ /dev/null @@ -1,1723 +0,0 @@ -// 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 -// -// 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. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/environments_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './environments_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Managed Apache Airflow Environments. - * @class - * @memberof v1beta1 - */ -export class EnvironmentsClient { - 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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - environmentsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of EnvironmentsClient. - * - * @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/main/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] - * @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 {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @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}. - * @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 EnvironmentsClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof EnvironmentsClient; - 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 = 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. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - 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 ? gaxInstance.fallback : gaxInstance; - - // 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. - this._opts = opts; - - // 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; - } - - // Determine the client header string. - 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/${this._gaxModule.version}`); - } - 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}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - environmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/environments/{environment}' - ), - }; - - // 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 = { - listEnvironments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'environments') - }; - - 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.longrunning.Operations.DeleteOperation',delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createEnvironmentResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; - const createEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const updateEnvironmentResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; - const updateEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const deleteEnvironmentResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteEnvironmentMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const restartWebServerResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.Environment') as gax.protobuf.Type; - const restartWebServerMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const checkUpgradeResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse') as gax.protobuf.Type; - const checkUpgradeMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const saveSnapshotResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse') as gax.protobuf.Type; - const saveSnapshotMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - const loadSnapshotResponse = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse') as gax.protobuf.Type; - const loadSnapshotMetadata = protoFilesRoot.lookup( - '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createEnvironmentResponse.decode.bind(createEnvironmentResponse), - createEnvironmentMetadata.decode.bind(createEnvironmentMetadata)), - updateEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateEnvironmentResponse.decode.bind(updateEnvironmentResponse), - updateEnvironmentMetadata.decode.bind(updateEnvironmentMetadata)), - deleteEnvironment: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), - deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata)), - restartWebServer: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartWebServerResponse.decode.bind(restartWebServerResponse), - restartWebServerMetadata.decode.bind(restartWebServerMetadata)), - checkUpgrade: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - checkUpgradeResponse.decode.bind(checkUpgradeResponse), - checkUpgradeMetadata.decode.bind(checkUpgradeMetadata)), - saveSnapshot: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - saveSnapshotResponse.decode.bind(saveSnapshotResponse), - saveSnapshotMetadata.decode.bind(saveSnapshotMetadata)), - loadSnapshot: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - loadSnapshotResponse.decode.bind(loadSnapshotResponse), - loadSnapshotMetadata.decode.bind(loadSnapshotMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.orchestration.airflow.service.v1beta1.Environments', 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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * 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.environmentsStub) { - return this.environmentsStub; - } - - // Put together the "service stub" for - // google.cloud.orchestration.airflow.service.v1beta1.Environments. - this.environmentsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1beta1.Environments') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.orchestration.airflow.service.v1beta1.Environments, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const environmentsStubMethods = - ['createEnvironment', 'getEnvironment', 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', 'restartWebServer', 'checkUpgrade', 'saveSnapshot', 'loadSnapshot']; - for (const methodName of environmentsStubMethods) { - const callPromise = this.environmentsStub.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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.environmentsStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'composer.googleapis.com'; - } - - /** - * 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 'composer.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Get an existing environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource name of the environment to get, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. - * 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/v1beta1/environments.get_environment.js - * region_tag:composer_v1beta1_generated_Environments_GetEnvironment_async - */ - getEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|undefined, {}|undefined - ]>; - getEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): void; - getEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, - callback: Callback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): void; - getEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment, - protos.google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getEnvironment(request, options, callback); - } - -/** - * Create a new environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The parent must be of the form - * "projects/{projectId}/locations/{locationId}". - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} request.environment - * The environment 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/v1beta1/environments.create_environment.js - * region_tag:composer_v1beta1_generated_Environments_CreateEnvironment_async - */ - createEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createEnvironment()`. - * @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 include:samples/generated/v1beta1/environments.create_environment.js - * region_tag:composer_v1beta1_generated_Environments_CreateEnvironment_async - */ - async checkCreateEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update an environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The relative resource name of the environment to update, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} request.environment - * A patch environment. Fields specified by the `updateMask` will be copied - * from the patch environment into the environment under update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A comma-separated list of paths, relative to `Environment`, of - * fields to update. - * For example, to set the version of scikit-learn to install in the - * environment to 0.19.0 and to remove an existing installation of - * argparse, the `updateMask` parameter would include the following two - * `paths` values: "config.softwareConfig.pypiPackages.scikit-learn" and - * "config.softwareConfig.pypiPackages.argparse". The included patch - * environment would specify the scikit-learn version as follows: - * - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "scikit-learn":"==0.19.0" - * } - * } - * } - * } - * - * Note that in the above example, any existing PyPI packages - * other than scikit-learn and argparse will be unaffected. - * - * Only one update type may be included in a single request's `updateMask`. - * For example, one cannot update both the PyPI packages and - * labels in the same request. However, it is possible to update multiple - * members of a map field simultaneously in the same request. For example, - * to set the labels "label1" and "label2" while clearing "label3" (assuming - * it already exists), one can - * provide the paths "labels.label1", "labels.label2", and "labels.label3" - * and populate the patch environment as follows: - * - * { - * "labels":{ - * "label1":"new-label1-value" - * "label2":"new-label2-value" - * } - * } - * - * Note that in the above example, any existing labels that are not - * included in the `updateMask` will be unaffected. - * - * It is also possible to replace an entire map field by providing the - * map field's path in the `updateMask`. The new value of the field will - * be that which is provided in the patch environment. For example, to - * delete all pre-existing user-specified PyPI packages and - * install botocore at version 1.7.14, the `updateMask` would contain - * the path "config.softwareConfig.pypiPackages", and - * the patch environment would be the following: - * - * { - * "config":{ - * "softwareConfig":{ - * "pypiPackages":{ - * "botocore":"==1.7.14" - * } - * } - * } - * } - * - * **Note:** Only the following fields can be updated: - * - * * `config.softwareConfig.pypiPackages` - * * Replace all custom custom PyPI packages. If a replacement - * package map is not included in `environment`, all custom - * PyPI packages are cleared. It is an error to provide both - * this mask and a mask specifying an individual package. - * * `config.softwareConfig.pypiPackages.`packagename - * * Update the custom PyPI package *packagename*, - * preserving other packages. To delete the package, include it in - * `updateMask`, and omit the mapping for it in - * `environment.config.softwareConfig.pypiPackages`. It is an error - * to provide both a mask of this form and the - * `config.softwareConfig.pypiPackages` mask. - * * `labels` - * * Replace all environment labels. If a replacement labels map is not - * included in `environment`, all labels are cleared. It is an error to - * provide both this mask and a mask specifying one or more individual - * labels. - * * `labels.`labelName - * * Set the label named *labelName*, while preserving other - * labels. To delete the label, include it in `updateMask` and omit its - * mapping in `environment.labels`. It is an error to provide both a - * mask of this form and the `labels` mask. - * * `config.nodeCount` - * * Horizontally scale the number of nodes in the environment. An integer - * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. Supported for Cloud Composer environments in versions - * composer-1.*.*-airflow-*.*.*. - * * `config.webServerNetworkAccessControl` - * * Replace the environment's current WebServerNetworkAccessControl. - * * `config.softwareConfig.airflowConfigOverrides` - * * Replace all Apache Airflow config overrides. If a replacement config - * overrides map is not included in `environment`, all config overrides - * are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual config overrides. - * * `config.softwareConfig.airflowConfigOverrides.`section-name - * * Override the Apache Airflow config property *name* in the - * section named *section*, preserving other properties. To - * delete the property override, include it in `updateMask` and omit its - * mapping in - * `environment.config.softwareConfig.airflowConfigOverrides`. - * It is an error to provide both a mask of this form and the - * `config.softwareConfig.airflowConfigOverrides` mask. - * * `config.softwareConfig.envVariables` - * * Replace all environment variables. If a replacement environment - * variable map is not included in `environment`, all custom environment - * variables are cleared. - * * `config.softwareConfig.imageVersion` - * * Upgrade the version of the environment in-place. Refer to - * `SoftwareConfig.image_version` for information on how to format the - * new image version. Additionally, the new image version cannot effect - * a version downgrade, and must match the current image version's - * Composer and Airflow major versions. Consult the [Cloud Composer - * version list](/composer/docs/concepts/versioning/composer-versions) - * for valid values. - * * `config.softwareConfig.schedulerCount` - * * Horizontally scale the number of schedulers in Airflow. A positive - * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. Supported for Cloud - * Composer environments in versions composer-1.*.*-airflow-2.*.*. - * * `config.softwareConfig.cloudDataLineageIntegration` - * * Configuration for Cloud Data Lineage integration. - * * `config.databaseConfig.machineType` - * * Cloud SQL machine type used by Airflow database. - * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer - * environments in versions composer-1.*.*-airflow-*.*.*. - * * `config.webServerConfig.machineType` - * * Machine type on which Airflow web server is running. - * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. Supported for Cloud Composer environments - * in versions composer-1.*.*-airflow-*.*.*. - * * `config.maintenanceWindow` - * * Maintenance window during which Cloud Composer components may be - * under maintenance. - * * `config.workloadsConfig` - * * The workloads configuration settings for the GKE cluster associated - * with the Cloud Composer environment. Supported for Cloud Composer - * environments in versions composer-2.*.*-airflow-*.*.* and newer. - * * `config.environmentSize` - * * The size of the Cloud Composer environment. Supported for Cloud - * Composer environments in versions composer-2.*.*-airflow-*.*.* and - * newer. - * @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/v1beta1/environments.update_environment.js - * region_tag:composer_v1beta1_generated_Environments_UpdateEnvironment_async - */ - updateEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateEnvironment()`. - * @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 include:samples/generated/v1beta1/environments.update_environment.js - * region_tag:composer_v1beta1_generated_Environments_UpdateEnvironment_async - */ - async checkUpdateEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Delete an environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The environment to delete, in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @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/v1beta1/environments.delete_environment.js - * region_tag:composer_v1beta1_generated_Environments_DeleteEnvironment_async - */ - deleteEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEnvironment( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteEnvironment( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteEnvironment(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteEnvironment()`. - * @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 include:samples/generated/v1beta1/environments.delete_environment.js - * region_tag:composer_v1beta1_generated_Environments_DeleteEnvironment_async - */ - async checkDeleteEnvironmentProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEnvironment, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restart Airflow web server. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource name of the environment to restart the web server for, in the - * form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @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/v1beta1/environments.restart_web_server.js - * region_tag:composer_v1beta1_generated_Environments_RestartWebServer_async - */ - restartWebServer( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartWebServer( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartWebServer( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartWebServer( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.restartWebServer(request, options, callback); - } -/** - * Check the status of the long running operation returned by `restartWebServer()`. - * @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 include:samples/generated/v1beta1/environments.restart_web_server.js - * region_tag:composer_v1beta1_generated_Environments_RestartWebServer_async - */ - async checkRestartWebServerProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.restartWebServer, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Check if an upgrade operation on the environment will succeed. - * - * In case of problems detailed info can be found in the returned Operation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.environment - * The resource name of the environment to check upgrade for, in the - * form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {string} request.imageVersion - * The version of the software running in the environment. - * This encapsulates both the version of Cloud Composer functionality and the - * version of Apache Airflow. It must match the regular expression - * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. - * When used as input, the server also checks if the provided version is - * supported and denies the request for an unsupported version. - * - * The Cloud Composer portion of the image version is a full - * [semantic version](https://semver.org), or an alias in the form of major - * version number or `latest`. When an alias is provided, the server replaces - * it with the current Cloud Composer version that satisfies the alias. - * - * The Apache Airflow portion of the image version is a full semantic version - * that points to one of the supported Apache Airflow versions, or an alias in - * the form of only major or major.minor versions specified. When an alias is - * provided, the server replaces it with the latest Apache Airflow version - * that satisfies the alias and is supported in the given Cloud Composer - * version. - * - * In all cases, the resolved image version is stored in the same field. - * - * See also [version - * list](/composer/docs/concepts/versioning/composer-versions) and [versioning - * overview](/composer/docs/concepts/versioning/composer-versioning-overview). - * @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/v1beta1/environments.check_upgrade.js - * region_tag:composer_v1beta1_generated_Environments_CheckUpgrade_async - */ - checkUpgrade( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - checkUpgrade( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkUpgrade( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - checkUpgrade( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'environment': request.environment ?? '', - }); - this.initialize(); - return this.innerApiCalls.checkUpgrade(request, options, callback); - } -/** - * Check the status of the long running operation returned by `checkUpgrade()`. - * @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 include:samples/generated/v1beta1/environments.check_upgrade.js - * region_tag:composer_v1beta1_generated_Environments_CheckUpgrade_async - */ - async checkCheckUpgradeProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkUpgrade, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a snapshots of a Cloud Composer environment. - * - * As a result of this operation, snapshot of environment's state is stored - * in a location specified in the SaveSnapshotRequest. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.environment - * The resource name of the source environment in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {string} request.snapshotLocation - * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: - * "gs://my-bucket/snapshots". - * @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/v1beta1/environments.save_snapshot.js - * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async - */ - saveSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - saveSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - saveSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - saveSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'environment': request.environment ?? '', - }); - this.initialize(); - return this.innerApiCalls.saveSnapshot(request, options, callback); - } -/** - * Check the status of the long running operation returned by `saveSnapshot()`. - * @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 include:samples/generated/v1beta1/environments.save_snapshot.js - * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async - */ - async checkSaveSnapshotProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.saveSnapshot, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Loads a snapshot of a Cloud Composer environment. - * - * As a result of this operation, a snapshot of environment's specified in - * LoadSnapshotRequest is loaded into the environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.environment - * The resource name of the target environment in the form: - * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" - * @param {string} request.snapshotPath - * A Cloud Storage path to a snapshot to load, e.g.: - * "gs://my-bucket/snapshots/project_location_environment_timestamp". - * @param {boolean} request.skipPypiPackagesInstallation - * Whether or not to skip installing Pypi packages when loading the - * environment's state. - * @param {boolean} request.skipEnvironmentVariablesSetting - * Whether or not to skip setting environment variables when loading the - * environment's state. - * @param {boolean} request.skipAirflowOverridesSetting - * Whether or not to skip setting Airflow overrides when loading the - * environment's state. - * @param {boolean} request.skipGcsDataCopying - * Whether or not to skip copying Cloud Storage data when loading the - * environment's state. - * @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/v1beta1/environments.load_snapshot.js - * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async - */ - loadSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - loadSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - loadSnapshot( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - loadSnapshot( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, - optionsOrCallback?: 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: 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'environment': request.environment ?? '', - }); - this.initialize(); - return this.innerApiCalls.loadSnapshot(request, options, callback); - } -/** - * Check the status of the long running operation returned by `loadSnapshot()`. - * @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 include:samples/generated/v1beta1/environments.load_snapshot.js - * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async - */ - async checkLoadSnapshotProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.loadSnapshot, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List environments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. - * 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. - * Note that it can affect your quota. - * We recommend using `listEnvironmentsAsync()` - * 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. - */ - listEnvironments( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[], - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse - ]>; - listEnvironments( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): void; - listEnvironments( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): void; - listEnvironments( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>, - callback?: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[], - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listEnvironments(request, options, callback); - } - -/** - * 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 - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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 [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment} 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 `listEnvironmentsAsync()` - * 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. - */ - listEnvironmentsStream( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEnvironments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEnvironments.createStream( - this.innerApiCalls.listEnvironments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEnvironments`, 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 - * List environments in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of environments to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @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). - * When you iterate the returned iterable, each element will be an object representing - * [Environment]{@link google.cloud.orchestration.airflow.service.v1beta1.Environment}. 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 include:samples/generated/v1beta1/environments.list_environments.js - * region_tag:composer_v1beta1_generated_Environments_ListEnvironments_async - */ - listEnvironmentsAsync( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listEnvironments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listEnvironments.asyncIterate( - this.innerApiCalls['listEnvironments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @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 - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @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 {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 {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @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)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @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)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified environment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} environment - * @returns {string} Resource name string. - */ - environmentPath(project:string,location:string,environment:string) { - return this.pathTemplates.environmentPathTemplate.render({ - project: project, - location: location, - environment: environment, - }); - } - - /** - * Parse the project from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).project; - } - - /** - * Parse the location from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).location; - } - - /** - * Parse the environment from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the environment. - */ - matchEnvironmentFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; - } - - /** - * 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 { - if (this.environmentsStub && !this._terminated) { - return this.environmentsStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json deleted file mode 100644 index f31d666bb58..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_client_config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "interfaces": { - "google.cloud.orchestration.airflow.service.v1beta1.Environments": { - "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": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEnvironments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteEnvironment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartWebServer": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckUpgrade": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SaveSnapshot": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "LoadSnapshot": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json deleted file mode 100644 index c854c306722..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/environments_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto" -] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 7dfe380be56..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.orchestration.airflow.service.v1beta1", - "libraryPackage": "@google-cloud/orchestration-airflow", - "services": { - "Environments": { - "clients": { - "grpc": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "GetEnvironment": { - "methods": [ - "getEnvironment" - ] - }, - "CreateEnvironment": { - "methods": [ - "createEnvironment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "updateEnvironment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "deleteEnvironment" - ] - }, - "RestartWebServer": { - "methods": [ - "restartWebServer" - ] - }, - "CheckUpgrade": { - "methods": [ - "checkUpgrade" - ] - }, - "SaveSnapshot": { - "methods": [ - "saveSnapshot" - ] - }, - "LoadSnapshot": { - "methods": [ - "loadSnapshot" - ] - }, - "ListEnvironments": { - "methods": [ - "listEnvironments", - "listEnvironmentsStream", - "listEnvironmentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "EnvironmentsClient", - "rpcs": { - "GetEnvironment": { - "methods": [ - "getEnvironment" - ] - }, - "CreateEnvironment": { - "methods": [ - "createEnvironment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "updateEnvironment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "deleteEnvironment" - ] - }, - "RestartWebServer": { - "methods": [ - "restartWebServer" - ] - }, - "CheckUpgrade": { - "methods": [ - "checkUpgrade" - ] - }, - "SaveSnapshot": { - "methods": [ - "saveSnapshot" - ] - }, - "LoadSnapshot": { - "methods": [ - "loadSnapshot" - ] - }, - "ListEnvironments": { - "methods": [ - "listEnvironments", - "listEnvironmentsStream", - "listEnvironmentsAsync" - ] - } - } - } - } - }, - "ImageVersions": { - "clients": { - "grpc": { - "libraryClient": "ImageVersionsClient", - "rpcs": { - "ListImageVersions": { - "methods": [ - "listImageVersions", - "listImageVersionsStream", - "listImageVersionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ImageVersionsClient", - "rpcs": { - "ListImageVersions": { - "methods": [ - "listImageVersions", - "listImageVersionsStream", - "listImageVersionsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts deleted file mode 100644 index 3884db4d148..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client.ts +++ /dev/null @@ -1,557 +0,0 @@ -// 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 -// -// 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. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/image_versions_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './image_versions_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Readonly service to query available ImageVersions. - * @class - * @memberof v1beta1 - */ -export class ImageVersionsClient { - 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: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - imageVersionsStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ImageVersionsClient. - * - * @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/main/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] - * @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 {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @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}. - * @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 ImageVersionsClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ImageVersionsClient; - 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 = 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. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - 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 ? gaxInstance.fallback : gaxInstance; - - // 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. - this._opts = opts; - - // 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; - } - - // Determine the client header string. - 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/${this._gaxModule.version}`); - } - 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}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - environmentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/environments/{environment}' - ), - }; - - // 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 = { - listImageVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'imageVersions') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.orchestration.airflow.service.v1beta1.ImageVersions', 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 = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * 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.imageVersionsStub) { - return this.imageVersionsStub; - } - - // Put together the "service stub" for - // google.cloud.orchestration.airflow.service.v1beta1.ImageVersions. - this.imageVersionsStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.orchestration.airflow.service.v1beta1.ImageVersions') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.orchestration.airflow.service.v1beta1.ImageVersions, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const imageVersionsStubMethods = - ['listImageVersions']; - for (const methodName of imageVersionsStubMethods) { - const callPromise = this.imageVersionsStub.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); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.imageVersionsStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'composer.googleapis.com'; - } - - /** - * 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 'composer.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - - /** - * List ImageVersions for provided location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion}. - * 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. - * Note that it can affect your quota. - * We recommend using `listImageVersionsAsync()` - * 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. - */ - listImageVersions( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[], - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse - ]>; - listImageVersions( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): void; - listImageVersions( - request: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): void; - listImageVersions( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>, - callback?: PaginationCallback< - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse|null|undefined, - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion>): - Promise<[ - protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[], - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest|null, - protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsResponse - ]>|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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listImageVersions(request, options, callback); - } - -/** - * 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 - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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 [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion} 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 `listImageVersionsAsync()` - * 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. - */ - listImageVersionsStream( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listImageVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listImageVersions.createStream( - this.innerApiCalls.listImageVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listImageVersions`, 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 - * List ImageVersions in the given project and location, in the form: - * "projects/{projectId}/locations/{locationId}" - * @param {number} request.pageSize - * The maximum number of image_versions to return. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {boolean} request.includePastReleases - * Whether or not image versions from old releases should be included. - * @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). - * When you iterate the returned iterable, each element will be an object representing - * [ImageVersion]{@link google.cloud.orchestration.airflow.service.v1beta1.ImageVersion}. 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 include:samples/generated/v1beta1/image_versions.list_image_versions.js - * region_tag:composer_v1beta1_generated_ImageVersions_ListImageVersions_async - */ - listImageVersionsAsync( - request?: protos.google.cloud.orchestration.airflow.service.v1beta1.IListImageVersionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listImageVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listImageVersions.asyncIterate( - this.innerApiCalls['listImageVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified environment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} environment - * @returns {string} Resource name string. - */ - environmentPath(project:string,location:string,environment:string) { - return this.pathTemplates.environmentPathTemplate.render({ - project: project, - location: location, - environment: environment, - }); - } - - /** - * Parse the project from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).project; - } - - /** - * Parse the location from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).location; - } - - /** - * Parse the environment from Environment resource. - * - * @param {string} environmentName - * A fully-qualified path representing Environment resource. - * @returns {string} A string representing the environment. - */ - matchEnvironmentFromEnvironmentName(environmentName: string) { - return this.pathTemplates.environmentPathTemplate.match(environmentName).environment; - } - - /** - * 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 { - if (this.imageVersionsStub && !this._terminated) { - return this.imageVersionsStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json deleted file mode 100644 index 9db3275858a..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_client_config.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "interfaces": { - "google.cloud.orchestration.airflow.service.v1beta1.ImageVersions": { - "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": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListImageVersions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json deleted file mode 100644 index c854c306722..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/image_versions_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto", - "../../protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto" -] diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index 9a109a1d699..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// 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 -// -// 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 {EnvironmentsClient} from './environments_client'; -export {ImageVersionsClient} from './image_versions_client'; diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 3d4b3363bc8..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// 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 -// -// 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 service = require('@google-cloud/orchestration-airflow'); - -function main() { - const environmentsClient = new service.EnvironmentsClient(); - const imageVersionsClient = new service.ImageVersionsClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 63551cdc1e7..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// 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 -// -// 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 {EnvironmentsClient, ImageVersionsClient} from '@google-cloud/orchestration-airflow'; - -// check that the client class type name can be used -function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { - client.close(); -} -function doStuffWithImageVersionsClient(client: ImageVersionsClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const environmentsClient = new EnvironmentsClient(); - doStuffWithEnvironmentsClient(environmentsClient); - // check that the client instance can be created - const imageVersionsClient = new ImageVersionsClient(); - doStuffWithImageVersionsClient(imageVersionsClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts deleted file mode 100644 index 557a57558e1..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// 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 -// -// 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'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts deleted file mode 100644 index 4cbf306b3b3..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_environments_v1beta1.ts +++ /dev/null @@ -1,1948 +0,0 @@ -// 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 -// -// 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 environmentsModule from '../src'; - -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) - .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('v1beta1.EnvironmentsClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = environmentsModule.v1beta1.EnvironmentsClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = environmentsModule.v1beta1.EnvironmentsClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = environmentsModule.v1beta1.EnvironmentsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.environmentsStub, undefined); - await client.initialize(); - assert(client.environmentsStub); - }); - - it('has close method for the initialized client', done => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.environmentsStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.environmentsStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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 environmentsModule.v1beta1.EnvironmentsClient({ - 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('getEnvironment', () => { - it('invokes getEnvironment without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment() - ); - client.innerApiCalls.getEnvironment = stubSimpleCall(expectedResponse); - const [response] = await client.getEnvironment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment() - ); - client.innerApiCalls.getEnvironment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEnvironment( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEnvironment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEnvironment with closed client', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getEnvironment(request), expectedError); - }); - }); - - describe('createEnvironment', () => { - it('invokes createEnvironment without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.createEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createEnvironment( - 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); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createEnvironment with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkCreateEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkCreateEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateEnvironment', () => { - it('invokes updateEnvironment without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateEnvironment( - 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); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateEnvironment with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkUpdateEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkUpdateEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteEnvironment', () => { - it('invokes deleteEnvironment without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteEnvironment(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteEnvironment = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteEnvironment( - 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); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEnvironment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteEnvironment with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEnvironment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEnvironment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEnvironment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteEnvironmentProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkDeleteEnvironmentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteEnvironmentProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkDeleteEnvironmentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartWebServer', () => { - it('invokes restartWebServer without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartWebServer = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartWebServer(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartWebServer without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restartWebServer = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartWebServer( - 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); - const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartWebServer with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartWebServer = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartWebServer(request), expectedError); - const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restartWebServer with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restartWebServer = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartWebServer(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restartWebServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestartWebServerProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkRestartWebServerProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartWebServerProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkRestartWebServerProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('checkUpgrade', () => { - it('invokes checkUpgrade without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.checkUpgrade = stubLongRunningCall(expectedResponse); - const [operation] = await client.checkUpgrade(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgrade without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.checkUpgrade = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkUpgrade( - 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); - const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgrade with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkUpgrade = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.checkUpgrade(request), expectedError); - const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpgrade with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkUpgrade = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.checkUpgrade(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkUpgrade as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCheckUpgradeProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkCheckUpgradeProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCheckUpgradeProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkCheckUpgradeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('saveSnapshot', () => { - it('invokes saveSnapshot without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); - const [operation] = await client.saveSnapshot(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.saveSnapshot = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.saveSnapshot( - 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); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.saveSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes saveSnapshot with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.saveSnapshot = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.saveSnapshot(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.saveSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSaveSnapshotProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkSaveSnapshotProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSaveSnapshotProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkSaveSnapshotProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('loadSnapshot', () => { - it('invokes loadSnapshot without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); - const [operation] = await client.loadSnapshot(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.loadSnapshot = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.loadSnapshot( - 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); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot with call error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.loadSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes loadSnapshot with LRO error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', ['environment']); - request.environment = defaultValue1; - const expectedHeaderRequestParams = `environment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.loadSnapshot = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.loadSnapshot(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.loadSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkLoadSnapshotProgress without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkLoadSnapshotProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkLoadSnapshotProgress with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - 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.checkLoadSnapshotProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listEnvironments', () => { - it('invokes listEnvironments without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - ]; - client.innerApiCalls.listEnvironments = stubSimpleCall(expectedResponse); - const [response] = await client.listEnvironments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironments without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - ]; - client.innerApiCalls.listEnvironments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEnvironments( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironments with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEnvironments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEnvironments(request), expectedError); - const actualRequest = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEnvironments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEnvironmentsStream without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - ]; - client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEnvironmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment) => { - 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.listEnvironments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); - assert( - (client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEnvironmentsStream with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEnvironments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEnvironmentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.Environment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEnvironments, request)); - assert( - (client.descriptors.page.listEnvironments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEnvironments without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.Environment()), - ]; - client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[] = []; - const iterable = client.listEnvironmentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEnvironments with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listEnvironments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEnvironmentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEnvironments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('environment', () => { - const fakePath = "/rendered/path/environment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - environment: "environmentValue", - }; - const client = new environmentsModule.v1beta1.EnvironmentsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.environmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.environmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('environmentPath', () => { - const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEnvironmentName', () => { - const result = client.matchProjectFromEnvironmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEnvironmentName', () => { - const result = client.matchLocationFromEnvironmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEnvironmentFromEnvironmentName', () => { - const result = client.matchEnvironmentFromEnvironmentName(fakePath); - assert.strictEqual(result, "environmentValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts deleted file mode 100644 index 4ab16296728..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/test/gapic_image_versions_v1beta1.ts +++ /dev/null @@ -1,491 +0,0 @@ -// 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 -// -// 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 imageversionsModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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) - .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 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('v1beta1.ImageVersionsClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = imageversionsModule.v1beta1.ImageVersionsClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = imageversionsModule.v1beta1.ImageVersionsClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = imageversionsModule.v1beta1.ImageVersionsClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.imageVersionsStub, undefined); - await client.initialize(); - assert(client.imageVersionsStub); - }); - - it('has close method for the initialized client', done => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.imageVersionsStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.imageVersionsStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - 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 imageversionsModule.v1beta1.ImageVersionsClient({ - 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('listImageVersions', () => { - it('invokes listImageVersions without error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - ]; - client.innerApiCalls.listImageVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listImageVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersions without error using callback', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - ]; - client.innerApiCalls.listImageVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listImageVersions( - request, - (err?: Error|null, result?: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersions with error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listImageVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listImageVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listImageVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listImageVersionsStream without error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - ]; - client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listImageVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion) => { - 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.listImageVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); - assert( - (client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listImageVersionsStream with error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listImageVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listImageVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion[] = []; - stream.on('data', (response: protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listImageVersions, request)); - assert( - (client.descriptors.page.listImageVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listImageVersions without error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - generateSampleMessage(new protos.google.cloud.orchestration.airflow.service.v1beta1.ImageVersion()), - ]; - client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[] = []; - const iterable = client.listImageVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listImageVersions with error', async () => { - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.orchestration.airflow.service.v1beta1.ListImageVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listImageVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listImageVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.orchestration.airflow.service.v1beta1.IImageVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listImageVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('environment', () => { - const fakePath = "/rendered/path/environment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - environment: "environmentValue", - }; - const client = new imageversionsModule.v1beta1.ImageVersionsClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.environmentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.environmentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('environmentPath', () => { - const result = client.environmentPath("projectValue", "locationValue", "environmentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.environmentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEnvironmentName', () => { - const result = client.matchProjectFromEnvironmentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEnvironmentName', () => { - const result = client.matchLocationFromEnvironmentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEnvironmentFromEnvironmentName', () => { - const result = client.matchEnvironmentFromEnvironmentName(fakePath); - assert.strictEqual(result, "environmentValue"); - assert((client.pathTemplates.environmentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js b/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js deleted file mode 100644 index 9b7becac60a..00000000000 --- a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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 -// -// 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'Environments', - filename: './environments.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - 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/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-orchestration-airflow-service/README.md b/packages/google-cloud-orchestration-airflow-service/README.md index 4b2db70d863..499834f8a41 100644 --- a/packages/google-cloud-orchestration-airflow-service/README.md +++ b/packages/google-cloud-orchestration-airflow-service/README.md @@ -92,6 +92,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.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-orchestration-airflow-service/samples/generated/v1/environments.delete_environment.js,samples/README.md) | | Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.get_environment.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-orchestration-airflow-service/samples/generated/v1/environments.get_environment.js,samples/README.md) | | Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.list_environments.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-orchestration-airflow-service/samples/generated/v1/environments.list_environments.js,samples/README.md) | +| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.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-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js,samples/README.md) | +| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.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-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js,samples/README.md) | | Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.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-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js,samples/README.md) | | Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_versions.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-orchestration-airflow-service/samples/generated/v1/image_versions.list_image_versions.js,samples/README.md) | | Environments.check_upgrade | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.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-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js,samples/README.md) | @@ -99,7 +101,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Environments.delete_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.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-orchestration-airflow-service/samples/generated/v1beta1/environments.delete_environment.js,samples/README.md) | | Environments.get_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.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-orchestration-airflow-service/samples/generated/v1beta1/environments.get_environment.js,samples/README.md) | | Environments.list_environments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.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-orchestration-airflow-service/samples/generated/v1beta1/environments.list_environments.js,samples/README.md) | +| Environments.load_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.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-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js,samples/README.md) | | Environments.restart_web_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.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-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js,samples/README.md) | +| Environments.save_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.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-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js,samples/README.md) | | Environments.update_environment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.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-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js,samples/README.md) | | Image_versions.list_image_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.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-orchestration-airflow-service/samples/generated/v1beta1/image_versions.list_image_versions.js,samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/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-orchestration-airflow-service/samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto index 0579d51acf6..0916ec9597d 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/environments.proto @@ -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. @@ -86,6 +86,36 @@ service Environments { metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" }; } + + // Creates a snapshots of a Cloud Composer environment. + // + // As a result of this operation, snapshot of environment's state is stored + // in a location specified in the SaveSnapshotRequest. + rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } + + // Loads a snapshot of a Cloud Composer environment. + // + // As a result of this operation, a snapshot of environment's specified in + // LoadSnapshotRequest is loaded into the environment. + rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }; + } } // Create a new environment. @@ -230,13 +260,10 @@ message UpdateEnvironmentRequest { // * `config.nodeCount` // * Horizontally scale the number of nodes in the environment. An integer // greater than or equal to 3 must be provided in the `config.nodeCount` - // field. + // field. Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. // * `config.webServerNetworkAccessControl` // * Replace the environment's current `WebServerNetworkAccessControl`. - // * `config.databaseConfig` - // * Replace the environment's current `DatabaseConfig`. - // * `config.webServerConfig` - // * Replace the environment's current `WebServerConfig`. // * `config.softwareConfig.airflowConfigOverrides` // * Replace all Apache Airflow config overrides. If a replacement config // overrides map is not included in `environment`, all config overrides @@ -254,14 +281,94 @@ message UpdateEnvironmentRequest { // * `config.softwareConfig.envVariables` // * Replace all environment variables. If a replacement environment // variable map is not included in `environment`, all custom environment - // variables are cleared. - // It is an error to provide both this mask and a mask specifying one or - // more individual environment variables. + // variables are cleared. + // * `config.softwareConfig.schedulerCount` + // * Horizontally scale the number of schedulers in Airflow. A positive + // integer not greater than the number of nodes must be provided in the + // `config.softwareConfig.schedulerCount` field. Supported for Cloud + // Composer environments in versions composer-1.*.*-airflow-2.*.*. + // * `config.databaseConfig.machineType` + // * Cloud SQL machine type used by Airflow database. + // It has to be one of: db-n1-standard-2, db-n1-standard-4, + // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + // environments in versions composer-1.*.*-airflow-*.*.*. + // * `config.webServerConfig.machineType` + // * Machine type on which Airflow web server is running. + // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + // or composer-n1-webserver-8. Supported for Cloud Composer environments + // in versions composer-1.*.*-airflow-*.*.*. google.protobuf.FieldMask update_mask = 3; } +// Request to create a snapshot of a Cloud Composer environment. +message SaveSnapshotRequest { + // The resource name of the source environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + // "gs://my-bucket/snapshots". + string snapshot_location = 2; +} + +// Response to SaveSnapshotRequest. +message SaveSnapshotResponse { + // The fully-resolved Cloud Storage path of the created snapshot, + // e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + // This field is populated only if the snapshot creation was successful. + string snapshot_path = 1; +} + +// Request to load a snapshot into a Cloud Composer environment. +message LoadSnapshotRequest { + // The resource name of the target environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // A Cloud Storage path to a snapshot to load, e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + string snapshot_path = 2; + + // Whether or not to skip installing Pypi packages when loading the + // environment's state. + bool skip_pypi_packages_installation = 3; + + // Whether or not to skip setting environment variables when loading the + // environment's state. + bool skip_environment_variables_setting = 4; + + // Whether or not to skip setting Airflow overrides when loading the + // environment's state. + bool skip_airflow_overrides_setting = 5; + + // Whether or not to skip copying Cloud Storage data when loading the + // environment's state. + bool skip_gcs_data_copying = 6; +} + +// Response to LoadSnapshotRequest. +message LoadSnapshotResponse { + +} + // Configuration information for an environment. message EnvironmentConfig { + // The size of the Cloud Composer environment. + enum EnvironmentSize { + // The size of the environment is unspecified. + ENVIRONMENT_SIZE_UNSPECIFIED = 0; + + // The environment size is small. + ENVIRONMENT_SIZE_SMALL = 1; + + // The environment size is medium. + ENVIRONMENT_SIZE_MEDIUM = 2; + + // The environment size is large. + ENVIRONMENT_SIZE_LARGE = 3; + } + // Output only. The Kubernetes Engine cluster used to run this environment. string gke_cluster = 1; @@ -273,6 +380,9 @@ message EnvironmentConfig { // The number of nodes in the Kubernetes Engine cluster that will be // used to run this environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. int32 node_count = 3; // The configuration settings for software inside the environment. @@ -299,10 +409,53 @@ message EnvironmentConfig { // and its dependencies. Cannot be updated. EncryptionConfig encryption_config = 11 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The maintenance window is the period when Cloud Composer components may + // undergo maintenance. It is defined so that maintenance is not executed + // during peak hours or critical time periods. + // + // The system will not be under maintenance for every occurrence of this + // window, but when maintenance is planned, it will be scheduled + // during the window. + // + // The maintenance window period must encompass at least 12 hours per week. + // This may be split into multiple chunks, each with a size of + // at least 4 hours. + // + // If this value is omitted, the default value for maintenance window will be + // applied. The default value is Saturday and Sunday 00-06 GMT. + MaintenanceWindow maintenance_window = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The workloads configuration settings for the GKE cluster associated with + // the Cloud Composer environment. The GKE cluster runs Airflow scheduler, web + // server and workers workloads. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + WorkloadsConfig workloads_config = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the Cloud Composer environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; + // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see // [Airflow web // interface](/composer/docs/how-to/accessing/airflow-web-interface)). string airflow_uri = 6; + + // Optional. The configuration options for GKE cluster master authorized networks. + // By default master authorized networks feature is: + // - in case of private environment: enabled with no external networks + // allowlisted. + // - in case of public environment: disabled. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Recovery settings configuration of an environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; } // Network-level access control policy for the Airflow web server. @@ -333,10 +486,14 @@ message DatabaseConfig { // Optional. Cloud SQL machine type used by Airflow database. // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. + // Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; } // The configuration settings for the Airflow web server App Engine instance. +// Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.* message WebServerConfig { // Optional. Machine type on which Airflow web server is running. // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or @@ -348,7 +505,8 @@ message WebServerConfig { } // The encryption options for the Cloud Composer environment -// and its dependencies. +// and its dependencies.Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. message EncryptionConfig { // Optional. Customer-managed Encryption Key available through Google's Key Management // Service. Cannot be updated. @@ -356,28 +514,62 @@ message EncryptionConfig { string kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; } +// The configuration settings for Cloud Composer maintenance window. +// The following example: +// +// ``` +// { +// "startTime":"2019-08-01T01:00:00Z" +// "endTime":"2019-08-01T07:00:00Z" +// "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE" +// } +// ``` +// +// would define a maintenance window between 01 and 07 hours UTC during +// each Tuesday and Wednesday. +message MaintenanceWindow { + // Required. Start time of the first recurrence of the maintenance window. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window end time. It is used only to calculate the duration of + // the maintenance window. + // The value for end-time must be in the future, relative to + // `start_time`. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Maintenance window recurrence. Format is a subset of + // [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed + // values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...` + // Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`. + string recurrence = 3 [(google.api.field_behavior) = REQUIRED]; +} + // Specifies the selection and configuration of software inside the environment. message SoftwareConfig { // The version of the software running in the environment. // This encapsulates both the version of Cloud Composer functionality and the // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[0-9]+(\.[0-9]+.*)?`. + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. // When used as input, the server also checks if the provided version is // supported and denies the request for an unsupported version. // - // The Cloud Composer portion of the version is a - // [semantic version](https://semver.org) or `latest`. When the patch version - // is omitted, the current Cloud Composer patch version is selected. - // When `latest` is provided instead of an explicit version number, - // the server replaces `latest` with the current Cloud Composer version - // and stores that version number in the same field. + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. // - // The portion of the image version that follows *airflow-* is an - // official Apache Airflow repository - // [release name](https://github.com/apache/incubator-airflow/releases). + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. // - // See also [Version - // List](/composer/docs/concepts/versioning/composer-versions). + // In all cases, the resolved image version is stored in the same field. + // + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). string image_version = 1; // Optional. Apache Airflow configuration properties to override. @@ -436,7 +628,17 @@ message SoftwareConfig { // // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be // updated. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // Python major version 3. string python_version = 6; + + // Optional. The number of schedulers for Airflow. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-2.*.*. + int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; } // Configuration for controlling how IPs are allocated in the @@ -444,6 +646,10 @@ message SoftwareConfig { message IPAllocationPolicy { // Optional. Whether or not to enable Alias IPs in the GKE cluster. // If `true`, a VPC-native cluster is created. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // VPC-native GKE clusters. bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; // Configuration of allocating IP addresses for pods in the GKE cluster. @@ -451,13 +657,15 @@ message IPAllocationPolicy { // Optional. The name of the GKE cluster's secondary range used to allocate // IP addresses to pods. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The IP address range used to allocate IP addresses to pods in // the GKE cluster. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. // // Set to blank to have GKE choose a range with the default size. // @@ -465,7 +673,7 @@ message IPAllocationPolicy { // netmask. // // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range // to use. @@ -477,13 +685,15 @@ message IPAllocationPolicy { // Optional. The name of the services' secondary range used to allocate // IP addresses to the GKE cluster. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The IP address range of the services IP addresses in this // GKE cluster. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. // // Set to blank to have GKE choose a range with the default size. // @@ -491,7 +701,7 @@ message IPAllocationPolicy { // netmask. // // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range // to use. @@ -516,6 +726,9 @@ message NodeConfig { // both fields. If only one field (`location` or `nodeConfig.machineType`) is // specified, the location information from the specified field will be // propagated to the unspecified field. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string location = 1; // Optional. The Compute Engine @@ -539,6 +752,9 @@ message NodeConfig { // // If this field is unspecified, the `machineTypeId` defaults // to "n1-standard-1". + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string machine_type = 2; // Optional. The Compute Engine network to be used for machine @@ -565,13 +781,19 @@ message NodeConfig { // location. string subnetwork = 4; - // Optional. The disk size in GB used for node VMs. Minimum size is 20GB. + // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. // If unspecified, defaults to 100GB. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. int32 disk_size_gb = 5; // Optional. The set of Google API scopes to be made available on all // node VMs. If `oauth_scopes` is empty, defaults to // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. repeated string oauth_scopes = 6; // Optional. The Google Cloud Platform Service Account to be used by the node @@ -583,10 +805,21 @@ message NodeConfig { // to identify valid sources or targets for network firewalls. Each tag within // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. repeated string tags = 8; // Optional. The configuration for controlling how IPs are allocated in the GKE cluster. IPAllocationPolicy ip_allocation_policy = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines + // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for + // all destination addresses, except between pods traffic. + // + // See: + // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent + bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; } // Configuration options for the private GKE cluster in a Cloud Composer @@ -608,12 +841,39 @@ message PrivateClusterConfig { string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Configuration options for networking connections in the Composer 2 +// environment. +message NetworkingConfig { + // Represents connection type between Composer environment in Customer + // Project and the corresponding Tenant project, from a predefined list + // of available connection modes. + enum ConnectionType { + // No specific connection type was requested, so the environment uses + // the default value corresponding to the rest of its configuration. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Requests the use of VPC peerings for connecting the Customer and Tenant + // projects. + VPC_PEERING = 1; + + // Requests the use of Private Service Connect for connecting the Customer + // and Tenant projects. + PRIVATE_SERVICE_CONNECT = 2; + } + + // Optional. Indicates the user requested specifc connection type between Tenant and + // Customer projects. + // You cannot set networking connection type in public IP environment. + ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + // The configuration information for configuring a Private IP Cloud Composer // environment. message PrivateEnvironmentConfig { // Optional. If `true`, a Private IP Cloud Composer environment is created. // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be - // set to true. + // set to true for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Configuration for the private GKE cluster for a Private IP @@ -623,6 +883,9 @@ message PrivateEnvironmentConfig { // Optional. The CIDR block from which IP range for web server will be reserved. Needs // to be disjoint from `private_cluster_config.master_ipv4_cidr_block` and // `cloud_sql_ipv4_cidr_block`. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The CIDR block from which IP range in tenant project will be reserved for @@ -630,7 +893,143 @@ message PrivateEnvironmentConfig { string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; // Output only. The IP range reserved for the tenant project's App Engine VMs. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant + // project will be reserved. Needs to be disjoint from + // private_cluster_config.master_ipv4_cidr_block and + // cloud_sql_ipv4_cidr_block. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_cidr_block = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The IP range reserved for the tenant project's Cloud Composer network. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for + // `IPAllocationPolicy.cluster_ipv4_cidr_block` and + // `IPAllocationPolicy.service_ipv4_cidr_block`. + bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specified, the environment will use Private Service Connect + // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, + // and the PSC endpoint in the Customer Project will use an IP address from + // this subnetwork. + string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the network connections configuration in the environment. + NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Kubernetes workloads configuration for GKE cluster associated with the +// Cloud Composer environment. Supported for Cloud Composer environments in +// versions composer-2.*.*-airflow-*.*.* and newer. +message WorkloadsConfig { + // Configuration for resources used by Airflow schedulers. + message SchedulerResource { + // Optional. CPU request and limit for a single Airflow scheduler replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow scheduler replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow scheduler replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of schedulers. + int32 count = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow web server. + message WebServerResource { + // Optional. CPU request and limit for Airflow web server. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for Airflow web server. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for Airflow web server. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for resources used by Airflow workers. + message WorkerResource { + // Optional. CPU request and limit for a single Airflow worker replica. + float cpu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow worker replica. + float memory_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Storage (GB) request and limit for a single Airflow worker replica. + float storage_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of workers for autoscaling. + int32 min_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of workers for autoscaling. + int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Resources used by Airflow schedulers. + SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow web server. + WebServerResource web_server = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow workers. + WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Recovery settings of an environment. +message RecoveryConfig { + // Optional. The configuration for scheduled snapshot creation mechanism. + ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration for scheduled snapshot creation mechanism. +message ScheduledSnapshotsConfig { + // Optional. Whether scheduled snapshots creation is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage location for storing automatically created snapshots. + string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cron expression representing the time when snapshots creation mechanism + // runs. This field is subject to additional validation around frequency of + // execution. + string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +message MasterAuthorizedNetworksConfig { + // CIDR block with an optional name. + message CidrBlock { + // User-defined name that identifies the CIDR block. + string display_name = 1; + + // CIDR block that must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks feature is enabled. + bool enabled = 1; + + // Up to 50 external networks that could access Kubernetes master through + // HTTPS. + repeated CidrBlock cidr_blocks = 2; } // An environment for running orchestration tasks. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto index ea65c8d8541..8226c463b80 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/image_versions.proto @@ -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. @@ -66,7 +66,7 @@ message ListImageVersionsResponse { // ImageVersion information message ImageVersion { // The string identifier of the ImageVersion, in the form: - // "composer-x.y.z-airflow-a.b(.c)" + // "composer-x.y.z-airflow-a.b.c" string image_version_id = 1; // Whether this is the default ImageVersion used by Composer during diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto index 9bb3a05dd10..332e09623b9 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1/operations.proto @@ -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. @@ -63,6 +63,12 @@ message OperationMetadata { // A resource check operation. CHECK = 4; + + // Saves snapshot of the resource operation. + SAVE_SNAPSHOT = 5; + + // Loads snapshot of the resource operation. + LOAD_SNAPSHOT = 6; } // Output only. The current operation state. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto index a96a417fc91..b2797ea7a41 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/environments.proto @@ -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. @@ -112,6 +112,36 @@ service Environments { metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" }; } + + // Creates a snapshots of a Cloud Composer environment. + // + // As a result of this operation, snapshot of environment's state is stored + // in a location specified in the SaveSnapshotRequest. + rpc SaveSnapshot(SaveSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:saveSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } + + // Loads a snapshot of a Cloud Composer environment. + // + // As a result of this operation, a snapshot of environment's specified in + // LoadSnapshotRequest is loaded into the environment. + rpc LoadSnapshot(LoadSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{environment=projects/*/locations/*/environments/*}:loadSnapshot" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse" + metadata_type: "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }; + } } // Create a new environment. @@ -256,7 +286,9 @@ message UpdateEnvironmentRequest { // * `config.nodeCount` // * Horizontally scale the number of nodes in the environment. An integer // greater than or equal to 3 must be provided in the `config.nodeCount` - // field. * `config.webServerNetworkAccessControl` + // field. Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. + // * `config.webServerNetworkAccessControl` // * Replace the environment's current WebServerNetworkAccessControl. // * `config.softwareConfig.airflowConfigOverrides` // * Replace all Apache Airflow config overrides. If a replacement config @@ -275,30 +307,43 @@ message UpdateEnvironmentRequest { // * `config.softwareConfig.envVariables` // * Replace all environment variables. If a replacement environment // variable map is not included in `environment`, all custom environment - // variables are cleared. - // It is an error to provide both this mask and a mask specifying one or - // more individual environment variables. + // variables are cleared. // * `config.softwareConfig.imageVersion` // * Upgrade the version of the environment in-place. Refer to // `SoftwareConfig.image_version` for information on how to format the // new image version. Additionally, the new image version cannot effect - // a version downgrade and must match the current image version's - // Composer major version and Airflow major and minor versions. Consult - // the [Cloud Composer Version - // List](https://cloud.google.com/composer/docs/concepts/versioning/composer-versions) + // a version downgrade, and must match the current image version's + // Composer and Airflow major versions. Consult the [Cloud Composer + // version list](/composer/docs/concepts/versioning/composer-versions) // for valid values. // * `config.softwareConfig.schedulerCount` // * Horizontally scale the number of schedulers in Airflow. A positive // integer not greater than the number of nodes must be provided in the - // `config.softwareConfig.schedulerCount` field. * `config.databaseConfig.machineType` + // `config.softwareConfig.schedulerCount` field. Supported for Cloud + // Composer environments in versions composer-1.*.*-airflow-2.*.*. + // * `config.softwareConfig.cloudDataLineageIntegration` + // * Configuration for Cloud Data Lineage integration. + // * `config.databaseConfig.machineType` // * Cloud SQL machine type used by Airflow database. // It has to be one of: db-n1-standard-2, db-n1-standard-4, - // db-n1-standard-8 or db-n1-standard-16. * `config.webServerConfig.machineType` + // db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + // environments in versions composer-1.*.*-airflow-*.*.*. + // * `config.webServerConfig.machineType` // * Machine type on which Airflow web server is running. // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - // or composer-n1-webserver-8. * `config.maintenanceWindow` + // or composer-n1-webserver-8. Supported for Cloud Composer environments + // in versions composer-1.*.*-airflow-*.*.*. + // * `config.maintenanceWindow` // * Maintenance window during which Cloud Composer components may be // under maintenance. + // * `config.workloadsConfig` + // * The workloads configuration settings for the GKE cluster associated + // with the Cloud Composer environment. Supported for Cloud Composer + // environments in versions composer-2.*.*-airflow-*.*.* and newer. + // * `config.environmentSize` + // * The size of the Cloud Composer environment. Supported for Cloud + // Composer environments in versions composer-2.*.*-airflow-*.*.* and + // newer. google.protobuf.FieldMask update_mask = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -310,6 +355,104 @@ message RestartWebServerRequest { string name = 1; } +// Response to ExecuteAirflowCommandRequest. +message ExecuteAirflowCommandResponse { + // The unique ID of the command execution for polling. + string execution_id = 1; + + // The name of the pod where the command is executed. + string pod = 2; + + // The namespace of the pod where the command is executed. + string pod_namespace = 3; + + // Error message. Empty if there was no error. + string error = 4; +} + +// Response to PollAirflowCommandRequest. +message PollAirflowCommandResponse { + // Contains information about a single line from logs. + message Line { + // Number of the line. + int32 line_number = 1; + + // Text content of the log line. + string content = 2; + } + + // Information about how a command ended. + message ExitInfo { + // The exit code from the command execution. + int32 exit_code = 1; + + // Error message. Empty if there was no error. + string error = 2; + } + + // Output from the command execution. It may not contain the full output + // and the caller may need to poll for more lines. + repeated Line output = 1; + + // Whether the command execution has finished and there is no more output. + bool output_end = 2; + + // The result exit status of the command. + ExitInfo exit_info = 3; +} + +// Request to create a snapshot of a Cloud Composer environment. +message SaveSnapshotRequest { + // The resource name of the source environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + // "gs://my-bucket/snapshots". + string snapshot_location = 2; +} + +// Response to SaveSnapshotRequest. +message SaveSnapshotResponse { + // The fully-resolved Cloud Storage path of the created snapshot, + // e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + // This field is populated only if the snapshot creation was successful. + string snapshot_path = 1; +} + +// Request to load a snapshot into a Cloud Composer environment. +message LoadSnapshotRequest { + // The resource name of the target environment in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + string environment = 1; + + // A Cloud Storage path to a snapshot to load, e.g.: + // "gs://my-bucket/snapshots/project_location_environment_timestamp". + string snapshot_path = 2; + + // Whether or not to skip installing Pypi packages when loading the + // environment's state. + bool skip_pypi_packages_installation = 3; + + // Whether or not to skip setting environment variables when loading the + // environment's state. + bool skip_environment_variables_setting = 4; + + // Whether or not to skip setting Airflow overrides when loading the + // environment's state. + bool skip_airflow_overrides_setting = 5; + + // Whether or not to skip copying Cloud Storage data when loading the + // environment's state. + bool skip_gcs_data_copying = 6; +} + +// Response to LoadSnapshotRequest. +message LoadSnapshotResponse { + +} + // Configuration information for an environment. message EnvironmentConfig { // The size of the Cloud Composer environment. @@ -338,6 +481,9 @@ message EnvironmentConfig { // The number of nodes in the Kubernetes Engine cluster that will be // used to run this environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. int32 node_count = 3; // The configuration settings for software inside the environment. @@ -358,6 +504,9 @@ message EnvironmentConfig { DatabaseConfig database_config = 10 [(google.api.field_behavior) = OPTIONAL]; // Optional. The configuration settings for the Airflow web server App Engine instance. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. WebServerConfig web_server_config = 11 [(google.api.field_behavior) = OPTIONAL]; // Output only. The URI of the Apache Airflow Web UI hosted within this environment (see @@ -398,6 +547,19 @@ message EnvironmentConfig { // This field is supported for Cloud Composer environments in versions // composer-2.*.*-airflow-*.*.* and newer. EnvironmentSize environment_size = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration options for GKE cluster master authorized networks. + // By default master authorized networks feature is: + // - in case of private environment: enabled with no external networks + // allowlisted. + // - in case of public environment: disabled. + MasterAuthorizedNetworksConfig master_authorized_networks_config = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Recovery settings configuration of an environment. + // + // This field is supported for Cloud Composer environments in versions + // composer-2.*.*-airflow-*.*.* and newer. + RecoveryConfig recovery_config = 18 [(google.api.field_behavior) = OPTIONAL]; } // Network-level access control policy for the Airflow web server. @@ -427,23 +589,27 @@ message SoftwareConfig { // The version of the software running in the environment. // This encapsulates both the version of Cloud Composer functionality and the // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[0-9]+(\.[0-9]+.*)?`. + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. // When used as input, the server also checks if the provided version is // supported and denies the request for an unsupported version. // - // The Cloud Composer portion of the version is a - // [semantic version](https://semver.org) or `latest`. When the patch version - // is omitted, the current Cloud Composer patch version is selected. - // When `latest` is provided instead of an explicit version number, - // the server replaces `latest` with the current Cloud Composer version - // and stores that version number in the same field. + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. + // + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. // - // The portion of the image version that follows *airflow-* is an - // official Apache Airflow repository - // [release name](https://github.com/apache/incubator-airflow/releases). + // In all cases, the resolved image version is stored in the same field. // - // See also [Version - // List](/composer/docs/concepts/versioning/composer-versions). + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). string image_version = 1; // Optional. Apache Airflow configuration properties to override. @@ -502,7 +668,20 @@ message SoftwareConfig { // // Can be set to '2' or '3'. If not specified, the default is '3'. Cannot be // updated. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // Python major version 3. string python_version = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of schedulers for Airflow. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-2.*.*. + int32 scheduler_count = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The configuration for Cloud Data Lineage integration. + CloudDataLineageIntegration cloud_data_lineage_integration = 8 [(google.api.field_behavior) = OPTIONAL]; } // Configuration for controlling how IPs are allocated in the @@ -510,27 +689,33 @@ message SoftwareConfig { message IPAllocationPolicy { // Optional. Whether or not to enable Alias IPs in the GKE cluster. // If `true`, a VPC-native cluster is created. + // + // This field is only supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. Environments in newer versions always use + // VPC-native GKE clusters. bool use_ip_aliases = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The name of the cluster's secondary range used to allocate // IP addresses to pods. Specify either `cluster_secondary_range_name` // or `cluster_ipv4_cidr_block` but not both. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. string cluster_secondary_range_name = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The name of the services' secondary range used to allocate // IP addresses to the cluster. Specify either `services_secondary_range_name` // or `services_ipv4_cidr_block` but not both. // - // This field is applicable only when `use_ip_aliases` is true. + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. string services_secondary_range_name = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The IP address range used to allocate IP addresses to pods in // the cluster. // - // This field is applicable only when `use_ip_aliases` is true. - // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. // // Set to blank to have GKE choose a range with the default size. // @@ -538,7 +723,7 @@ message IPAllocationPolicy { // netmask. // // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range // to use. @@ -549,8 +734,8 @@ message IPAllocationPolicy { // Optional. The IP address range of the services IP addresses in this // cluster. // - // This field is applicable only when `use_ip_aliases` is true. - // + // For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, + // this field is applicable only when `use_ip_aliases` is true. // // Set to blank to have GKE choose a range with the default size. // @@ -558,7 +743,7 @@ message IPAllocationPolicy { // netmask. // // Set to a - // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + // [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range // to use. @@ -584,6 +769,9 @@ message NodeConfig { // both fields. If only one field (`location` or `nodeConfig.machineType`) is // specified, the location information from the specified field will be // propagated to the unspecified field. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string location = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The Compute Engine @@ -607,6 +795,9 @@ message NodeConfig { // // If this field is unspecified, the `machineTypeId` defaults // to "n1-standard-1". + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string machine_type = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The Compute Engine network to be used for machine @@ -633,13 +824,19 @@ message NodeConfig { // location. string subnetwork = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The disk size in GB used for node VMs. Minimum size is 20GB. + // Optional. The disk size in GB used for node VMs. Minimum size is 30GB. // If unspecified, defaults to 100GB. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. int32 disk_size_gb = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. The set of Google API scopes to be made available on all // node VMs. If `oauth_scopes` is empty, defaults to // ["https://www.googleapis.com/auth/cloud-platform"]. Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. repeated string oauth_scopes = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. The Google Cloud Platform Service Account to be used by the workloads. If a @@ -651,6 +848,9 @@ message NodeConfig { // to identify valid sources or targets for network firewalls. Each tag within // the list must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. repeated string tags = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. The IPAllocationPolicy fields for the GKE cluster. @@ -666,7 +866,18 @@ message NodeConfig { // For more information, see [Optimizing IP address allocation] // (https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr). // Cannot be updated. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. int32 max_pods_per_node = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines + // nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for + // all destination addresses, except between pods traffic. + // + // See: + // https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent + bool enable_ip_masq_agent = 11 [(google.api.field_behavior) = OPTIONAL]; } // Configuration options for the private GKE cluster in a Cloud Composer @@ -688,12 +899,39 @@ message PrivateClusterConfig { string master_ipv4_reserved_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Configuration options for networking connections in the Composer 2 +// environment. +message NetworkingConfig { + // Represents connection type between Composer environment in Customer + // Project and the corresponding Tenant project, from a predefined list + // of available connection modes. + enum ConnectionType { + // No specific connection type was requested, so the environment uses + // the default value corresponding to the rest of its configuration. + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Requests the use of VPC peerings for connecting the Customer and Tenant + // projects. + VPC_PEERING = 1; + + // Requests the use of Private Service Connect for connecting the Customer + // and Tenant projects. + PRIVATE_SERVICE_CONNECT = 2; + } + + // Optional. Indicates the user requested specifc connection type between Tenant and + // Customer projects. + // You cannot set networking connection type in public IP environment. + ConnectionType connection_type = 1 [(google.api.field_behavior) = OPTIONAL]; +} + // The configuration information for configuring a Private IP Cloud Composer // environment. message PrivateEnvironmentConfig { // Optional. If `true`, a Private IP Cloud Composer environment is created. // If this field is set to true, `IPAllocationPolicy.use_ip_aliases` must be - // set to true . + // set to true for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. bool enable_private_environment = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Configuration for the private GKE cluster for a Private IP @@ -703,6 +941,9 @@ message PrivateEnvironmentConfig { // Optional. The CIDR block from which IP range for web server will be reserved. Needs // to be disjoint from private_cluster_config.master_ipv4_cidr_block and // cloud_sql_ipv4_cidr_block. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string web_server_ipv4_cidr_block = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. The CIDR block from which IP range in tenant project will be reserved for @@ -710,6 +951,9 @@ message PrivateEnvironmentConfig { string cloud_sql_ipv4_cidr_block = 4 [(google.api.field_behavior) = OPTIONAL]; // Output only. The IP range reserved for the tenant project's App Engine VMs. + // + // This field is supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string web_server_ipv4_reserved_range = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. The CIDR block from which IP range for Cloud Composer Network in tenant @@ -726,6 +970,20 @@ message PrivateEnvironmentConfig { // This field is supported for Cloud Composer environments in versions // composer-2.*.*-airflow-*.*.* and newer. string cloud_composer_network_ipv4_reserved_range = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When enabled, IPs from public (non-RFC1918) ranges can be used for + // `IPAllocationPolicy.cluster_ipv4_cidr_block` and + // `IPAllocationPolicy.service_ipv4_cidr_block`. + bool enable_privately_used_public_ips = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When specified, the environment will use Private Service Connect + // instead of VPC peerings to connect to Cloud SQL in the Tenant Project, + // and the PSC endpoint in the Customer Project will use an IP address from + // this subnetwork. + string cloud_composer_connection_subnetwork = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for the network connections configuration in the environment. + NetworkingConfig networking_config = 10 [(google.api.field_behavior) = OPTIONAL]; } // The configuration of Cloud SQL instance that is used by the Apache Airflow @@ -734,10 +992,14 @@ message DatabaseConfig { // Optional. Cloud SQL machine type used by Airflow database. // It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 // or db-n1-standard-16. If not specified, db-n1-standard-2 will be used. + // Supported for Cloud Composer environments in versions + // composer-1.*.*-airflow-*.*.*. string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; } // The configuration settings for the Airflow web server App Engine instance. +// Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. message WebServerConfig { // Optional. Machine type on which Airflow web server is running. // It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or @@ -749,7 +1011,8 @@ message WebServerConfig { } // The encryption options for the Cloud Composer environment and its -// dependencies. +// dependencies. Supported for Cloud Composer environments in versions +// composer-1.*.*-airflow-*.*.*. message EncryptionConfig { // Optional. Customer-managed Encryption Key available through Google's Key Management // Service. Cannot be updated. @@ -835,6 +1098,18 @@ message WorkloadsConfig { int32 max_count = 5 [(google.api.field_behavior) = OPTIONAL]; } + // Configuration for resources used by Airflow triggerers. + message TriggererResource { + // Optional. The number of triggerers. + int32 count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CPU request and limit for a single Airflow triggerer replica. + float cpu = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Memory (GB) request and limit for a single Airflow triggerer replica. + float memory_gb = 3 [(google.api.field_behavior) = OPTIONAL]; + } + // Optional. Resources used by Airflow schedulers. SchedulerResource scheduler = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -843,6 +1118,60 @@ message WorkloadsConfig { // Optional. Resources used by Airflow workers. WorkerResource worker = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resources used by Airflow triggerers. + TriggererResource triggerer = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The Recovery settings of an environment. +message RecoveryConfig { + // Optional. The configuration for scheduled snapshot creation mechanism. + ScheduledSnapshotsConfig scheduled_snapshots_config = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration for scheduled snapshot creation mechanism. +message ScheduledSnapshotsConfig { + // Optional. Whether scheduled snapshots creation is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage location for storing automatically created snapshots. + string snapshot_location = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cron expression representing the time when snapshots creation mechanism + // runs. This field is subject to additional validation around frequency of + // execution. + string snapshot_creation_schedule = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time zone that sets the context to interpret snapshot_creation_schedule. + string time_zone = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration options for the master authorized networks feature. Enabled +// master authorized networks will disallow all external traffic to access +// Kubernetes master through HTTPS except traffic from the given CIDR blocks, +// Google Compute Engine Public IPs and Google Prod IPs. +message MasterAuthorizedNetworksConfig { + // CIDR block with an optional name. + message CidrBlock { + // User-defined name that identifies the CIDR block. + string display_name = 1; + + // CIDR block that must be specified in CIDR notation. + string cidr_block = 2; + } + + // Whether or not master authorized networks feature is enabled. + bool enabled = 1; + + // Up to 50 external networks that could access Kubernetes master through + // HTTPS. + repeated CidrBlock cidr_blocks = 2; +} + +// Configuration for Cloud Data Lineage integration. +message CloudDataLineageIntegration { + // Optional. Whether or not Cloud Data Lineage integration is enabled. + bool enabled = 1 [(google.api.field_behavior) = OPTIONAL]; } // An environment for running orchestration tasks. @@ -918,23 +1247,27 @@ message CheckUpgradeRequest { // The version of the software running in the environment. // This encapsulates both the version of Cloud Composer functionality and the // version of Apache Airflow. It must match the regular expression - // `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[0-9]+(\.[0-9]+.*)?`. + // `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. // When used as input, the server also checks if the provided version is // supported and denies the request for an unsupported version. // - // The Cloud Composer portion of the version is a - // [semantic version](https://semver.org) or `latest`. When the patch version - // is omitted, the current Cloud Composer patch version is selected. - // When `latest` is provided instead of an explicit version number, - // the server replaces `latest` with the current Cloud Composer version - // and stores that version number in the same field. + // The Cloud Composer portion of the image version is a full + // [semantic version](https://semver.org), or an alias in the form of major + // version number or `latest`. When an alias is provided, the server replaces + // it with the current Cloud Composer version that satisfies the alias. + // + // The Apache Airflow portion of the image version is a full semantic version + // that points to one of the supported Apache Airflow versions, or an alias in + // the form of only major or major.minor versions specified. When an alias is + // provided, the server replaces it with the latest Apache Airflow version + // that satisfies the alias and is supported in the given Cloud Composer + // version. // - // The portion of the image version that follows `airflow-` is an - // official Apache Airflow repository - // [release name](https://github.com/apache/incubator-airflow/releases). + // In all cases, the resolved image version is stored in the same field. // - // See also [Version List] - // (/composer/docs/concepts/versioning/composer-versions). + // See also [version + // list](/composer/docs/concepts/versioning/composer-versions) and [versioning + // overview](/composer/docs/concepts/versioning/composer-versioning-overview). string image_version = 2; } diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto index 6a7d5f4c6df..08bc9f0f587 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/image_versions.proto @@ -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. @@ -66,7 +66,7 @@ message ListImageVersionsResponse { // Image Version information message ImageVersion { // The string identifier of the ImageVersion, in the form: - // "composer-x.y.z-airflow-a.b(.c)" + // "composer-x.y.z-airflow-a.b.c" string image_version_id = 1; // Whether this is the default ImageVersion used by Composer during diff --git a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto index 5e5991f0c67..5ba18a52299 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto +++ b/packages/google-cloud-orchestration-airflow-service/protos/google/cloud/orchestration/airflow/service/v1beta1/operations.proto @@ -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. @@ -59,6 +59,12 @@ message OperationMetadata { // A resource check operation. CHECK = 4; + + // Saves snapshot of the resource operation. + SAVE_SNAPSHOT = 5; + + // Loads snapshot of the resource operation. + LOAD_SNAPSHOT = 6; } // Output only. The current operation state. diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts b/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts index bdac2dc56e8..b03d1835c2d 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.d.ts @@ -121,6 +121,34 @@ export namespace google { * @returns Promise */ public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1.IDeleteEnvironmentRequest): Promise; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshotCallback): void; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @returns Promise + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest): Promise; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshotCallback): void; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @returns Promise + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest): Promise; } namespace Environments { @@ -159,6 +187,20 @@ export namespace google { * @param [response] Operation */ type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|saveSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type SaveSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|loadSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type LoadSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a CreateEnvironmentRequest. */ @@ -779,4865 +821,8143 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EnvironmentConfig. */ - interface IEnvironmentConfig { - - /** EnvironmentConfig gkeCluster */ - gkeCluster?: (string|null); - - /** EnvironmentConfig dagGcsPrefix */ - dagGcsPrefix?: (string|null); - - /** EnvironmentConfig nodeCount */ - nodeCount?: (number|null); + /** Properties of a SaveSnapshotRequest. */ + interface ISaveSnapshotRequest { - /** EnvironmentConfig softwareConfig */ - softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); + /** SaveSnapshotRequest environment */ + environment?: (string|null); - /** EnvironmentConfig nodeConfig */ - nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); + /** SaveSnapshotRequest snapshotLocation */ + snapshotLocation?: (string|null); + } - /** EnvironmentConfig privateEnvironmentConfig */ - privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); + /** Represents a SaveSnapshotRequest. */ + class SaveSnapshotRequest implements ISaveSnapshotRequest { - /** EnvironmentConfig webServerNetworkAccessControl */ - webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); + /** + * Constructs a new SaveSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest); - /** EnvironmentConfig databaseConfig */ - databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); + /** SaveSnapshotRequest environment. */ + public environment: string; - /** EnvironmentConfig webServerConfig */ - webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); + /** SaveSnapshotRequest snapshotLocation. */ + public snapshotLocation: string; - /** EnvironmentConfig encryptionConfig */ - encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); + /** + * Creates a new SaveSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SaveSnapshotRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; - /** EnvironmentConfig airflowUri */ - airflowUri?: (string|null); - } + /** + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an EnvironmentConfig. */ - class EnvironmentConfig implements IEnvironmentConfig { + /** + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Constructs a new EnvironmentConfig. - * @param [properties] Properties to set + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaveSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig); + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; - /** EnvironmentConfig gkeCluster. */ - public gkeCluster: string; + /** + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaveSnapshotRequest + * @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.orchestration.airflow.service.v1.SaveSnapshotRequest; - /** EnvironmentConfig dagGcsPrefix. */ - public dagGcsPrefix: string; + /** + * Verifies a SaveSnapshotRequest 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); - /** EnvironmentConfig nodeCount. */ - public nodeCount: number; + /** + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaveSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest; - /** EnvironmentConfig softwareConfig. */ - public softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); + /** + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * @param message SaveSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnvironmentConfig nodeConfig. */ - public nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); + /** + * Converts this SaveSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** EnvironmentConfig privateEnvironmentConfig. */ - public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); + /** + * Gets the default type url for SaveSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** EnvironmentConfig webServerNetworkAccessControl. */ - public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); + /** Properties of a SaveSnapshotResponse. */ + interface ISaveSnapshotResponse { - /** EnvironmentConfig databaseConfig. */ - public databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); + /** SaveSnapshotResponse snapshotPath */ + snapshotPath?: (string|null); + } - /** EnvironmentConfig webServerConfig. */ - public webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); + /** Represents a SaveSnapshotResponse. */ + class SaveSnapshotResponse implements ISaveSnapshotResponse { - /** EnvironmentConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); + /** + * Constructs a new SaveSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse); - /** EnvironmentConfig airflowUri. */ - public airflowUri: string; + /** SaveSnapshotResponse snapshotPath. */ + public snapshotPath: string; /** - * Creates a new EnvironmentConfig instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @param [properties] Properties to set - * @returns EnvironmentConfig instance + * @returns SaveSnapshotResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnvironmentConfig + * @returns SaveSnapshotResponse * @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.orchestration.airflow.service.v1.EnvironmentConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnvironmentConfig + * @returns SaveSnapshotResponse * @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.orchestration.airflow.service.v1.EnvironmentConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Verifies an EnvironmentConfig message. + * Verifies a SaveSnapshotResponse 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 EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnvironmentConfig + * @returns SaveSnapshotResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse; /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. - * @param message EnvironmentConfig + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * @param message SaveSnapshotResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnvironmentConfig to JSON. + * Converts this SaveSnapshotResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EnvironmentConfig + * Gets the default type url for SaveSnapshotResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WebServerNetworkAccessControl. */ - interface IWebServerNetworkAccessControl { + /** Properties of a LoadSnapshotRequest. */ + interface ILoadSnapshotRequest { - /** WebServerNetworkAccessControl allowedIpRanges */ - allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); + /** LoadSnapshotRequest environment */ + environment?: (string|null); + + /** LoadSnapshotRequest snapshotPath */ + snapshotPath?: (string|null); + + /** LoadSnapshotRequest skipPypiPackagesInstallation */ + skipPypiPackagesInstallation?: (boolean|null); + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ + skipEnvironmentVariablesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipAirflowOverridesSetting */ + skipAirflowOverridesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipGcsDataCopying */ + skipGcsDataCopying?: (boolean|null); } - /** Represents a WebServerNetworkAccessControl. */ - class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { + /** Represents a LoadSnapshotRequest. */ + class LoadSnapshotRequest implements ILoadSnapshotRequest { /** - * Constructs a new WebServerNetworkAccessControl. + * Constructs a new LoadSnapshotRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest); - /** WebServerNetworkAccessControl allowedIpRanges. */ - public allowedIpRanges: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]; + /** LoadSnapshotRequest environment. */ + public environment: string; + + /** LoadSnapshotRequest snapshotPath. */ + public snapshotPath: string; + + /** LoadSnapshotRequest skipPypiPackagesInstallation. */ + public skipPypiPackagesInstallation: boolean; + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ + public skipEnvironmentVariablesSetting: boolean; + + /** LoadSnapshotRequest skipAirflowOverridesSetting. */ + public skipAirflowOverridesSetting: boolean; + + /** LoadSnapshotRequest skipGcsDataCopying. */ + public skipGcsDataCopying: boolean; /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * Creates a new LoadSnapshotRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerNetworkAccessControl instance + * @returns LoadSnapshotRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerNetworkAccessControl + * @returns LoadSnapshotRequest * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerNetworkAccessControl + * @returns LoadSnapshotRequest * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Verifies a WebServerNetworkAccessControl message. + * Verifies a LoadSnapshotRequest 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 WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerNetworkAccessControl + * @returns LoadSnapshotRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest; /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. - * @param message WebServerNetworkAccessControl + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @param message LoadSnapshotRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerNetworkAccessControl to JSON. + * Converts this LoadSnapshotRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerNetworkAccessControl + * Gets the default type url for LoadSnapshotRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace WebServerNetworkAccessControl { - - /** Properties of an AllowedIpRange. */ - interface IAllowedIpRange { + /** Properties of a LoadSnapshotResponse. */ + interface ILoadSnapshotResponse { + } - /** AllowedIpRange value */ - value?: (string|null); + /** Represents a LoadSnapshotResponse. */ + class LoadSnapshotResponse implements ILoadSnapshotResponse { - /** AllowedIpRange description */ - description?: (string|null); - } + /** + * Constructs a new LoadSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse); - /** Represents an AllowedIpRange. */ - class AllowedIpRange implements IAllowedIpRange { + /** + * Creates a new LoadSnapshotResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadSnapshotResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; - /** - * Constructs a new AllowedIpRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange); + /** + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** AllowedIpRange value. */ - public value: string; + /** + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** AllowedIpRange description. */ - public description: string; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadSnapshotResponse + * @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.orchestration.airflow.service.v1.LoadSnapshotResponse; - /** - * Creates a new AllowedIpRange instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedIpRange instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadSnapshotResponse + * @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.orchestration.airflow.service.v1.LoadSnapshotResponse; - /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a LoadSnapshotResponse 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 AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadSnapshotResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse; - /** - * Decodes an AllowedIpRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedIpRange - * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @param message LoadSnapshotResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedIpRange - * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Converts this LoadSnapshotResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Verifies an AllowedIpRange 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); + /** + * Gets the default type url for LoadSnapshotResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedIpRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + /** Properties of an EnvironmentConfig. */ + interface IEnvironmentConfig { - /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. - * @param message AllowedIpRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EnvironmentConfig gkeCluster */ + gkeCluster?: (string|null); - /** - * Converts this AllowedIpRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** EnvironmentConfig dagGcsPrefix */ + dagGcsPrefix?: (string|null); - /** - * Gets the default type url for AllowedIpRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } + /** EnvironmentConfig nodeCount */ + nodeCount?: (number|null); - /** Properties of a DatabaseConfig. */ - interface IDatabaseConfig { + /** EnvironmentConfig softwareConfig */ + softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); - /** DatabaseConfig machineType */ - machineType?: (string|null); + /** EnvironmentConfig nodeConfig */ + nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); + + /** EnvironmentConfig privateEnvironmentConfig */ + privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); + + /** EnvironmentConfig webServerNetworkAccessControl */ + webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); + + /** EnvironmentConfig databaseConfig */ + databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); + + /** EnvironmentConfig webServerConfig */ + webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); + + /** EnvironmentConfig encryptionConfig */ + encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); + + /** EnvironmentConfig maintenanceWindow */ + maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); + + /** EnvironmentConfig workloadsConfig */ + workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); + + /** EnvironmentConfig environmentSize */ + environmentSize?: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null); + + /** EnvironmentConfig airflowUri */ + airflowUri?: (string|null); + + /** EnvironmentConfig masterAuthorizedNetworksConfig */ + masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); + + /** EnvironmentConfig recoveryConfig */ + recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); } - /** Represents a DatabaseConfig. */ - class DatabaseConfig implements IDatabaseConfig { + /** Represents an EnvironmentConfig. */ + class EnvironmentConfig implements IEnvironmentConfig { /** - * Constructs a new DatabaseConfig. + * Constructs a new EnvironmentConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig); - /** DatabaseConfig machineType. */ - public machineType: string; + /** EnvironmentConfig gkeCluster. */ + public gkeCluster: string; + + /** EnvironmentConfig dagGcsPrefix. */ + public dagGcsPrefix: string; + + /** EnvironmentConfig nodeCount. */ + public nodeCount: number; + + /** EnvironmentConfig softwareConfig. */ + public softwareConfig?: (google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null); + + /** EnvironmentConfig nodeConfig. */ + public nodeConfig?: (google.cloud.orchestration.airflow.service.v1.INodeConfig|null); + + /** EnvironmentConfig privateEnvironmentConfig. */ + public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null); + + /** EnvironmentConfig webServerNetworkAccessControl. */ + public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null); + + /** EnvironmentConfig databaseConfig. */ + public databaseConfig?: (google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null); + + /** EnvironmentConfig webServerConfig. */ + public webServerConfig?: (google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null); + + /** EnvironmentConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null); + + /** EnvironmentConfig maintenanceWindow. */ + public maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null); + + /** EnvironmentConfig workloadsConfig. */ + public workloadsConfig?: (google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null); + + /** EnvironmentConfig environmentSize. */ + public environmentSize: (google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize); + + /** EnvironmentConfig airflowUri. */ + public airflowUri: string; + + /** EnvironmentConfig masterAuthorizedNetworksConfig. */ + public masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null); + + /** EnvironmentConfig recoveryConfig. */ + public recoveryConfig?: (google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null); /** - * Creates a new DatabaseConfig instance using the specified properties. + * Creates a new EnvironmentConfig instance using the specified properties. * @param [properties] Properties to set - * @returns DatabaseConfig instance + * @returns EnvironmentConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes an EnvironmentConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DatabaseConfig + * @returns EnvironmentConfig * @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.orchestration.airflow.service.v1.DatabaseConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DatabaseConfig + * @returns EnvironmentConfig * @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.orchestration.airflow.service.v1.DatabaseConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Verifies a DatabaseConfig message. + * Verifies an EnvironmentConfig 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 DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DatabaseConfig + * @returns EnvironmentConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EnvironmentConfig; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. - * @param message DatabaseConfig + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @param message EnvironmentConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DatabaseConfig to JSON. + * Converts this EnvironmentConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for EnvironmentConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WebServerConfig. */ - interface IWebServerConfig { + namespace EnvironmentConfig { - /** WebServerConfig machineType */ - machineType?: (string|null); + /** EnvironmentSize enum. */ + enum EnvironmentSize { + ENVIRONMENT_SIZE_UNSPECIFIED = 0, + ENVIRONMENT_SIZE_SMALL = 1, + ENVIRONMENT_SIZE_MEDIUM = 2, + ENVIRONMENT_SIZE_LARGE = 3 + } } - /** Represents a WebServerConfig. */ - class WebServerConfig implements IWebServerConfig { + /** Properties of a WebServerNetworkAccessControl. */ + interface IWebServerNetworkAccessControl { + + /** WebServerNetworkAccessControl allowedIpRanges */ + allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); + } + + /** Represents a WebServerNetworkAccessControl. */ + class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { /** - * Constructs a new WebServerConfig. + * Constructs a new WebServerNetworkAccessControl. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl); - /** WebServerConfig machineType. */ - public machineType: string; + /** WebServerNetworkAccessControl allowedIpRanges. */ + public allowedIpRanges: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange[]; /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new WebServerNetworkAccessControl instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerConfig instance + * @returns WebServerNetworkAccessControl instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerConfig + * @returns WebServerNetworkAccessControl * @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.orchestration.airflow.service.v1.WebServerConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerConfig + * @returns WebServerNetworkAccessControl * @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.orchestration.airflow.service.v1.WebServerConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Verifies a WebServerConfig message. + * Verifies a WebServerNetworkAccessControl 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 WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerConfig + * @returns WebServerNetworkAccessControl */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. - * @param message WebServerConfig + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * @param message WebServerNetworkAccessControl * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerConfig to JSON. + * Converts this WebServerNetworkAccessControl to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerConfig + * Gets the default type url for WebServerNetworkAccessControl * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { + namespace WebServerNetworkAccessControl { - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); + /** Properties of an AllowedIpRange. */ + interface IAllowedIpRange { + + /** AllowedIpRange value */ + value?: (string|null); + + /** AllowedIpRange description */ + description?: (string|null); + } + + /** Represents an AllowedIpRange. */ + class AllowedIpRange implements IAllowedIpRange { + + /** + * Constructs a new AllowedIpRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange); + + /** AllowedIpRange value. */ + public value: string; + + /** AllowedIpRange description. */ + public description: string; + + /** + * Creates a new AllowedIpRange instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedIpRange instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedIpRange + * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedIpRange + * @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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Verifies an AllowedIpRange 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 AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedIpRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @param message AllowedIpRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedIpRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedIpRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { + /** Properties of a DatabaseConfig. */ + interface IDatabaseConfig { + + /** DatabaseConfig machineType */ + machineType?: (string|null); + } + + /** Represents a DatabaseConfig. */ + class DatabaseConfig implements IDatabaseConfig { /** - * Constructs a new EncryptionConfig. + * Constructs a new DatabaseConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig); - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; + /** DatabaseConfig machineType. */ + public machineType: string; /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new DatabaseConfig instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionConfig instance + * @returns DatabaseConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a DatabaseConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionConfig + * @returns DatabaseConfig * @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.orchestration.airflow.service.v1.EncryptionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionConfig + * @returns DatabaseConfig * @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.orchestration.airflow.service.v1.EncryptionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; /** - * Verifies an EncryptionConfig message. + * Verifies a DatabaseConfig 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionConfig + * @returns DatabaseConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.DatabaseConfig; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * @param message DatabaseConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionConfig to JSON. + * Converts this DatabaseConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for DatabaseConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SoftwareConfig. */ - interface ISoftwareConfig { - - /** SoftwareConfig imageVersion */ - imageVersion?: (string|null); - - /** SoftwareConfig airflowConfigOverrides */ - airflowConfigOverrides?: ({ [k: string]: string }|null); - - /** SoftwareConfig pypiPackages */ - pypiPackages?: ({ [k: string]: string }|null); - - /** SoftwareConfig envVariables */ - envVariables?: ({ [k: string]: string }|null); + /** Properties of a WebServerConfig. */ + interface IWebServerConfig { - /** SoftwareConfig pythonVersion */ - pythonVersion?: (string|null); + /** WebServerConfig machineType */ + machineType?: (string|null); } - /** Represents a SoftwareConfig. */ - class SoftwareConfig implements ISoftwareConfig { + /** Represents a WebServerConfig. */ + class WebServerConfig implements IWebServerConfig { /** - * Constructs a new SoftwareConfig. + * Constructs a new WebServerConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig); - - /** SoftwareConfig imageVersion. */ - public imageVersion: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig); - /** SoftwareConfig airflowConfigOverrides. */ - public airflowConfigOverrides: { [k: string]: string }; - - /** SoftwareConfig pypiPackages. */ - public pypiPackages: { [k: string]: string }; - - /** SoftwareConfig envVariables. */ - public envVariables: { [k: string]: string }; - - /** SoftwareConfig pythonVersion. */ - public pythonVersion: string; + /** WebServerConfig machineType. */ + public machineType: string; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new WebServerConfig instance using the specified properties. * @param [properties] Properties to set - * @returns SoftwareConfig instance + * @returns WebServerConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes a WebServerConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SoftwareConfig + * @returns WebServerConfig * @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.orchestration.airflow.service.v1.SoftwareConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SoftwareConfig + * @returns WebServerConfig * @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.orchestration.airflow.service.v1.SoftwareConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Verifies a SoftwareConfig message. + * Verifies a WebServerConfig 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 SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SoftwareConfig + * @returns WebServerConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WebServerConfig; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. - * @param message SoftwareConfig + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * @param message WebServerConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SoftwareConfig to JSON. + * Converts this WebServerConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for WebServerConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a IPAllocationPolicy. */ - interface IIPAllocationPolicy { - - /** IPAllocationPolicy useIpAliases */ - useIpAliases?: (boolean|null); - - /** IPAllocationPolicy clusterSecondaryRangeName */ - clusterSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy clusterIpv4CidrBlock */ - clusterIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy servicesSecondaryRangeName */ - servicesSecondaryRangeName?: (string|null); + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { - /** IPAllocationPolicy servicesIpv4CidrBlock */ - servicesIpv4CidrBlock?: (string|null); + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); } - /** Represents a IPAllocationPolicy. */ - class IPAllocationPolicy implements IIPAllocationPolicy { + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { /** - * Constructs a new IPAllocationPolicy. + * Constructs a new EncryptionConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy); - - /** IPAllocationPolicy useIpAliases. */ - public useIpAliases: boolean; - - /** IPAllocationPolicy clusterSecondaryRangeName. */ - public clusterSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy clusterIpv4CidrBlock. */ - public clusterIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy servicesSecondaryRangeName. */ - public servicesSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy servicesIpv4CidrBlock. */ - public servicesIpv4CidrBlock?: (string|null); - - /** IPAllocationPolicy clusterIpAllocation. */ - public clusterIpAllocation?: ("clusterSecondaryRangeName"|"clusterIpv4CidrBlock"); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig); - /** IPAllocationPolicy servicesIpAllocation. */ - public servicesIpAllocation?: ("servicesSecondaryRangeName"|"servicesIpv4CidrBlock"); + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; /** - * Creates a new IPAllocationPolicy instance using the specified properties. + * Creates a new EncryptionConfig instance using the specified properties. * @param [properties] Properties to set - * @returns IPAllocationPolicy instance + * @returns EncryptionConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes an EncryptionConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IPAllocationPolicy + * @returns EncryptionConfig * @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.orchestration.airflow.service.v1.IPAllocationPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IPAllocationPolicy + * @returns EncryptionConfig * @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.orchestration.airflow.service.v1.IPAllocationPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Verifies a IPAllocationPolicy message. + * Verifies an EncryptionConfig 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 IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IPAllocationPolicy + * @returns EncryptionConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.EncryptionConfig; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. - * @param message IPAllocationPolicy + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this EncryptionConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for EncryptionConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NodeConfig. */ - interface INodeConfig { - - /** NodeConfig location */ - location?: (string|null); - - /** NodeConfig machineType */ - machineType?: (string|null); - - /** NodeConfig network */ - network?: (string|null); - - /** NodeConfig subnetwork */ - subnetwork?: (string|null); - - /** NodeConfig diskSizeGb */ - diskSizeGb?: (number|null); - - /** NodeConfig oauthScopes */ - oauthScopes?: (string[]|null); + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { - /** NodeConfig serviceAccount */ - serviceAccount?: (string|null); + /** MaintenanceWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** NodeConfig tags */ - tags?: (string[]|null); + /** MaintenanceWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** NodeConfig ipAllocationPolicy */ - ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + /** MaintenanceWindow recurrence */ + recurrence?: (string|null); } - /** Represents a NodeConfig. */ - class NodeConfig implements INodeConfig { + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { /** - * Constructs a new NodeConfig. + * Constructs a new MaintenanceWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig); - - /** NodeConfig location. */ - public location: string; - - /** NodeConfig machineType. */ - public machineType: string; - - /** NodeConfig network. */ - public network: string; - - /** NodeConfig subnetwork. */ - public subnetwork: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow); - /** NodeConfig diskSizeGb. */ - public diskSizeGb: number; - - /** NodeConfig oauthScopes. */ - public oauthScopes: string[]; - - /** NodeConfig serviceAccount. */ - public serviceAccount: string; + /** MaintenanceWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** NodeConfig tags. */ - public tags: string[]; + /** MaintenanceWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** NodeConfig ipAllocationPolicy. */ - public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + /** MaintenanceWindow recurrence. */ + public recurrence: string; /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new MaintenanceWindow instance using the specified properties. * @param [properties] Properties to set - * @returns NodeConfig instance + * @returns MaintenanceWindow instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes a MaintenanceWindow message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NodeConfig + * @returns MaintenanceWindow * @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.orchestration.airflow.service.v1.NodeConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NodeConfig + * @returns MaintenanceWindow * @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.orchestration.airflow.service.v1.NodeConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Verifies a NodeConfig message. + * Verifies a MaintenanceWindow 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 NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NodeConfig + * @returns MaintenanceWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NodeConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MaintenanceWindow; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. - * @param message NodeConfig + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NodeConfig to JSON. + * Converts this MaintenanceWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for MaintenanceWindow * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrivateClusterConfig. */ - interface IPrivateClusterConfig { + /** Properties of a SoftwareConfig. */ + interface ISoftwareConfig { - /** PrivateClusterConfig enablePrivateEndpoint */ - enablePrivateEndpoint?: (boolean|null); + /** SoftwareConfig imageVersion */ + imageVersion?: (string|null); - /** PrivateClusterConfig masterIpv4CidrBlock */ - masterIpv4CidrBlock?: (string|null); + /** SoftwareConfig airflowConfigOverrides */ + airflowConfigOverrides?: ({ [k: string]: string }|null); - /** PrivateClusterConfig masterIpv4ReservedRange */ - masterIpv4ReservedRange?: (string|null); + /** SoftwareConfig pypiPackages */ + pypiPackages?: ({ [k: string]: string }|null); + + /** SoftwareConfig envVariables */ + envVariables?: ({ [k: string]: string }|null); + + /** SoftwareConfig pythonVersion */ + pythonVersion?: (string|null); + + /** SoftwareConfig schedulerCount */ + schedulerCount?: (number|null); } - /** Represents a PrivateClusterConfig. */ - class PrivateClusterConfig implements IPrivateClusterConfig { + /** Represents a SoftwareConfig. */ + class SoftwareConfig implements ISoftwareConfig { /** - * Constructs a new PrivateClusterConfig. + * Constructs a new SoftwareConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig); - /** PrivateClusterConfig enablePrivateEndpoint. */ - public enablePrivateEndpoint: boolean; + /** SoftwareConfig imageVersion. */ + public imageVersion: string; - /** PrivateClusterConfig masterIpv4CidrBlock. */ - public masterIpv4CidrBlock: string; + /** SoftwareConfig airflowConfigOverrides. */ + public airflowConfigOverrides: { [k: string]: string }; - /** PrivateClusterConfig masterIpv4ReservedRange. */ - public masterIpv4ReservedRange: string; + /** SoftwareConfig pypiPackages. */ + public pypiPackages: { [k: string]: string }; + + /** SoftwareConfig envVariables. */ + public envVariables: { [k: string]: string }; + + /** SoftwareConfig pythonVersion. */ + public pythonVersion: string; + + /** SoftwareConfig schedulerCount. */ + public schedulerCount: number; /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * Creates a new SoftwareConfig instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateClusterConfig instance + * @returns SoftwareConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes a SoftwareConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateClusterConfig + * @returns SoftwareConfig * @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.orchestration.airflow.service.v1.PrivateClusterConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateClusterConfig + * @returns SoftwareConfig * @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.orchestration.airflow.service.v1.PrivateClusterConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Verifies a PrivateClusterConfig message. + * Verifies a SoftwareConfig 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 PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateClusterConfig + * @returns SoftwareConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.SoftwareConfig; /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. - * @param message PrivateClusterConfig + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @param message SoftwareConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this SoftwareConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for SoftwareConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrivateEnvironmentConfig. */ - interface IPrivateEnvironmentConfig { + /** Properties of a IPAllocationPolicy. */ + interface IIPAllocationPolicy { - /** PrivateEnvironmentConfig enablePrivateEnvironment */ - enablePrivateEnvironment?: (boolean|null); + /** IPAllocationPolicy useIpAliases */ + useIpAliases?: (boolean|null); - /** PrivateEnvironmentConfig privateClusterConfig */ - privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); + /** IPAllocationPolicy clusterSecondaryRangeName */ + clusterSecondaryRangeName?: (string|null); - /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ - webServerIpv4CidrBlock?: (string|null); + /** IPAllocationPolicy clusterIpv4CidrBlock */ + clusterIpv4CidrBlock?: (string|null); - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ - cloudSqlIpv4CidrBlock?: (string|null); + /** IPAllocationPolicy servicesSecondaryRangeName */ + servicesSecondaryRangeName?: (string|null); - /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ - webServerIpv4ReservedRange?: (string|null); + /** IPAllocationPolicy servicesIpv4CidrBlock */ + servicesIpv4CidrBlock?: (string|null); } - /** Represents a PrivateEnvironmentConfig. */ - class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { + /** Represents a IPAllocationPolicy. */ + class IPAllocationPolicy implements IIPAllocationPolicy { /** - * Constructs a new PrivateEnvironmentConfig. + * Constructs a new IPAllocationPolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy); - /** PrivateEnvironmentConfig enablePrivateEnvironment. */ - public enablePrivateEnvironment: boolean; + /** IPAllocationPolicy useIpAliases. */ + public useIpAliases: boolean; - /** PrivateEnvironmentConfig privateClusterConfig. */ - public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); + /** IPAllocationPolicy clusterSecondaryRangeName. */ + public clusterSecondaryRangeName?: (string|null); - /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ - public webServerIpv4CidrBlock: string; + /** IPAllocationPolicy clusterIpv4CidrBlock. */ + public clusterIpv4CidrBlock?: (string|null); - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ - public cloudSqlIpv4CidrBlock: string; + /** IPAllocationPolicy servicesSecondaryRangeName. */ + public servicesSecondaryRangeName?: (string|null); - /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ - public webServerIpv4ReservedRange: string; + /** IPAllocationPolicy servicesIpv4CidrBlock. */ + public servicesIpv4CidrBlock?: (string|null); + + /** IPAllocationPolicy clusterIpAllocation. */ + public clusterIpAllocation?: ("clusterSecondaryRangeName"|"clusterIpv4CidrBlock"); + + /** IPAllocationPolicy servicesIpAllocation. */ + public servicesIpAllocation?: ("servicesSecondaryRangeName"|"servicesIpv4CidrBlock"); /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * Creates a new IPAllocationPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateEnvironmentConfig instance + * @returns IPAllocationPolicy instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * Decodes a IPAllocationPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateEnvironmentConfig + * @returns IPAllocationPolicy * @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.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateEnvironmentConfig + * @returns IPAllocationPolicy * @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.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Verifies a PrivateEnvironmentConfig message. + * Verifies a IPAllocationPolicy 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 PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateEnvironmentConfig + * @returns IPAllocationPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. - * @param message PrivateEnvironmentConfig + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * @param message IPAllocationPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateEnvironmentConfig to JSON. + * Converts this IPAllocationPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateEnvironmentConfig + * Gets the default type url for IPAllocationPolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Environment. */ - interface IEnvironment { + /** Properties of a NodeConfig. */ + interface INodeConfig { - /** Environment name */ - name?: (string|null); + /** NodeConfig location */ + location?: (string|null); - /** Environment config */ - config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + /** NodeConfig machineType */ + machineType?: (string|null); - /** Environment uuid */ - uuid?: (string|null); + /** NodeConfig network */ + network?: (string|null); - /** Environment state */ - state?: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State|null); + /** NodeConfig subnetwork */ + subnetwork?: (string|null); - /** Environment createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig diskSizeGb */ + diskSizeGb?: (number|null); - /** Environment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig oauthScopes */ + oauthScopes?: (string[]|null); - /** Environment labels */ - labels?: ({ [k: string]: string }|null); + /** NodeConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NodeConfig tags */ + tags?: (string[]|null); + + /** NodeConfig ipAllocationPolicy */ + ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + + /** NodeConfig enableIpMasqAgent */ + enableIpMasqAgent?: (boolean|null); } - /** Represents an Environment. */ - class Environment implements IEnvironment { + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { /** - * Constructs a new Environment. + * Constructs a new NodeConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig); - /** Environment name. */ - public name: string; + /** NodeConfig location. */ + public location: string; - /** Environment config. */ - public config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + /** NodeConfig machineType. */ + public machineType: string; - /** Environment uuid. */ - public uuid: string; + /** NodeConfig network. */ + public network: string; - /** Environment state. */ - public state: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State); + /** NodeConfig subnetwork. */ + public subnetwork: string; - /** Environment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig diskSizeGb. */ + public diskSizeGb: number; - /** Environment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** NodeConfig oauthScopes. */ + public oauthScopes: string[]; - /** Environment labels. */ - public labels: { [k: string]: string }; + /** NodeConfig serviceAccount. */ + public serviceAccount: string; + + /** NodeConfig tags. */ + public tags: string[]; + + /** NodeConfig ipAllocationPolicy. */ + public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null); + + /** NodeConfig enableIpMasqAgent. */ + public enableIpMasqAgent: boolean; /** - * Creates a new Environment instance using the specified properties. + * Creates a new NodeConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Environment instance + * @returns NodeConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment): google.cloud.orchestration.airflow.service.v1.Environment; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.INodeConfig): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a NodeConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Environment + * @returns NodeConfig * @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.orchestration.airflow.service.v1.Environment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Environment + * @returns NodeConfig * @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.orchestration.airflow.service.v1.Environment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Verifies an Environment message. + * Verifies a NodeConfig 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 Environment message from a plain object. Also converts values to their respective internal types. + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Environment + * @returns NodeConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.Environment; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NodeConfig; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Environment to JSON. + * Converts this NodeConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Environment + * Gets the default type url for NodeConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Environment { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - RUNNING = 2, - UPDATING = 3, - DELETING = 4, - ERROR = 5 - } - } - - /** Properties of a CheckUpgradeResponse. */ - interface ICheckUpgradeResponse { - - /** CheckUpgradeResponse buildLogUri */ - buildLogUri?: (string|null); - - /** CheckUpgradeResponse containsPypiModulesConflict */ - containsPypiModulesConflict?: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null); + /** Properties of a PrivateClusterConfig. */ + interface IPrivateClusterConfig { - /** CheckUpgradeResponse pypiConflictBuildLogExtract */ - pypiConflictBuildLogExtract?: (string|null); + /** PrivateClusterConfig enablePrivateEndpoint */ + enablePrivateEndpoint?: (boolean|null); - /** CheckUpgradeResponse imageVersion */ - imageVersion?: (string|null); + /** PrivateClusterConfig masterIpv4CidrBlock */ + masterIpv4CidrBlock?: (string|null); - /** CheckUpgradeResponse pypiDependencies */ - pypiDependencies?: ({ [k: string]: string }|null); + /** PrivateClusterConfig masterIpv4ReservedRange */ + masterIpv4ReservedRange?: (string|null); } - /** Represents a CheckUpgradeResponse. */ - class CheckUpgradeResponse implements ICheckUpgradeResponse { + /** Represents a PrivateClusterConfig. */ + class PrivateClusterConfig implements IPrivateClusterConfig { /** - * Constructs a new CheckUpgradeResponse. + * Constructs a new PrivateClusterConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse); - - /** CheckUpgradeResponse buildLogUri. */ - public buildLogUri: string; - - /** CheckUpgradeResponse containsPypiModulesConflict. */ - public containsPypiModulesConflict: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig); - /** CheckUpgradeResponse pypiConflictBuildLogExtract. */ - public pypiConflictBuildLogExtract: string; + /** PrivateClusterConfig enablePrivateEndpoint. */ + public enablePrivateEndpoint: boolean; - /** CheckUpgradeResponse imageVersion. */ - public imageVersion: string; + /** PrivateClusterConfig masterIpv4CidrBlock. */ + public masterIpv4CidrBlock: string; - /** CheckUpgradeResponse pypiDependencies. */ - public pypiDependencies: { [k: string]: string }; + /** PrivateClusterConfig masterIpv4ReservedRange. */ + public masterIpv4ReservedRange: string; /** - * Creates a new CheckUpgradeResponse instance using the specified properties. + * Creates a new PrivateClusterConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CheckUpgradeResponse instance + * @returns PrivateClusterConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @param message CheckUpgradeResponse message or plain object to encode + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. - * @param message CheckUpgradeResponse message or plain object to encode + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer. + * Decodes a PrivateClusterConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CheckUpgradeResponse + * @returns PrivateClusterConfig * @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.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CheckUpgradeResponse + * @returns PrivateClusterConfig * @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.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Verifies a CheckUpgradeResponse message. + * Verifies a PrivateClusterConfig 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 CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CheckUpgradeResponse + * @returns PrivateClusterConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig; /** - * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. - * @param message CheckUpgradeResponse + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @param message PrivateClusterConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CheckUpgradeResponse to JSON. + * Converts this PrivateClusterConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CheckUpgradeResponse + * Gets the default type url for PrivateClusterConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CheckUpgradeResponse { + /** Properties of a NetworkingConfig. */ + interface INetworkingConfig { - /** ConflictResult enum. */ - enum ConflictResult { - CONFLICT_RESULT_UNSPECIFIED = 0, - CONFLICT = 1, - NO_CONFLICT = 2 - } + /** NetworkingConfig connectionType */ + connectionType?: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null); } - /** Represents an ImageVersions */ - class ImageVersions extends $protobuf.rpc.Service { + /** Represents a NetworkingConfig. */ + class NetworkingConfig implements INetworkingConfig { /** - * Constructs a new ImageVersions service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new NetworkingConfig. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig); + + /** NetworkingConfig connectionType. */ + public connectionType: (google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType); /** - * Creates new ImageVersions 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. + * Creates a new NetworkingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkingConfig instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ImageVersions; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.INetworkingConfig): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; /** - * Calls ListImageVersions. - * @param request ListImageVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListImageVersionsResponse + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, callback: google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback): void; + public static encode(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListImageVersions. - * @param request ListImageVersionsRequest message or plain object - * @returns Promise + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): Promise; - } + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - namespace ImageVersions { + /** + * Decodes a NetworkingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkingConfig + * @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.orchestration.airflow.service.v1.NetworkingConfig; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. - * @param error Error, if any - * @param [response] ListImageVersionsResponse + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListImageVersionsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) => void; - } + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; - /** Properties of a ListImageVersionsRequest. */ - interface IListImageVersionsRequest { + /** + * Verifies a NetworkingConfig 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); - /** ListImageVersionsRequest parent */ - parent?: (string|null); + /** + * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.NetworkingConfig; - /** ListImageVersionsRequest pageSize */ - pageSize?: (number|null); + /** + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * @param message NetworkingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.NetworkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListImageVersionsRequest pageToken */ - pageToken?: (string|null); + /** + * Converts this NetworkingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ListImageVersionsRequest includePastReleases */ - includePastReleases?: (boolean|null); + /** + * Gets the default type url for NetworkingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a ListImageVersionsRequest. */ - class ListImageVersionsRequest implements IListImageVersionsRequest { + namespace NetworkingConfig { + + /** ConnectionType enum. */ + enum ConnectionType { + CONNECTION_TYPE_UNSPECIFIED = 0, + VPC_PEERING = 1, + PRIVATE_SERVICE_CONNECT = 2 + } + } + + /** Properties of a PrivateEnvironmentConfig. */ + interface IPrivateEnvironmentConfig { + + /** PrivateEnvironmentConfig enablePrivateEnvironment */ + enablePrivateEnvironment?: (boolean|null); + + /** PrivateEnvironmentConfig privateClusterConfig */ + privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); + + /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ + webServerIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ + cloudSqlIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ + webServerIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock */ + cloudComposerNetworkIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange */ + cloudComposerNetworkIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps */ + enablePrivatelyUsedPublicIps?: (boolean|null); + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork */ + cloudComposerConnectionSubnetwork?: (string|null); + + /** PrivateEnvironmentConfig networkingConfig */ + networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); + } + + /** Represents a PrivateEnvironmentConfig. */ + class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { /** - * Constructs a new ListImageVersionsRequest. + * Constructs a new PrivateEnvironmentConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig); - /** ListImageVersionsRequest parent. */ - public parent: string; + /** PrivateEnvironmentConfig enablePrivateEnvironment. */ + public enablePrivateEnvironment: boolean; - /** ListImageVersionsRequest pageSize. */ - public pageSize: number; + /** PrivateEnvironmentConfig privateClusterConfig. */ + public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null); - /** ListImageVersionsRequest pageToken. */ - public pageToken: string; + /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ + public webServerIpv4CidrBlock: string; - /** ListImageVersionsRequest includePastReleases. */ - public includePastReleases: boolean; + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ + public cloudSqlIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ + public webServerIpv4ReservedRange: string; + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. */ + public cloudComposerNetworkIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. */ + public cloudComposerNetworkIpv4ReservedRange: string; + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. */ + public enablePrivatelyUsedPublicIps: boolean; + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. */ + public cloudComposerConnectionSubnetwork: string; + + /** PrivateEnvironmentConfig networkingConfig. */ + public networkingConfig?: (google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null); /** - * Creates a new ListImageVersionsRequest instance using the specified properties. + * Creates a new PrivateEnvironmentConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListImageVersionsRequest instance + * @returns PrivateEnvironmentConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. - * @param message ListImageVersionsRequest message or plain object to encode + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. - * @param message ListImageVersionsRequest message or plain object to encode + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListImageVersionsRequest + * @returns PrivateEnvironmentConfig * @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.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListImageVersionsRequest + * @returns PrivateEnvironmentConfig * @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.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Verifies a ListImageVersionsRequest message. + * Verifies a PrivateEnvironmentConfig 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 ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListImageVersionsRequest + * @returns PrivateEnvironmentConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig; /** - * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. - * @param message ListImageVersionsRequest + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * @param message PrivateEnvironmentConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListImageVersionsRequest to JSON. + * Converts this PrivateEnvironmentConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListImageVersionsRequest + * Gets the default type url for PrivateEnvironmentConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListImageVersionsResponse. */ - interface IListImageVersionsResponse { + /** Properties of a WorkloadsConfig. */ + interface IWorkloadsConfig { - /** ListImageVersionsResponse imageVersions */ - imageVersions?: (google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null); + /** WorkloadsConfig scheduler */ + scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); - /** ListImageVersionsResponse nextPageToken */ - nextPageToken?: (string|null); + /** WorkloadsConfig webServer */ + webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker */ + worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); } - /** Represents a ListImageVersionsResponse. */ - class ListImageVersionsResponse implements IListImageVersionsResponse { + /** Represents a WorkloadsConfig. */ + class WorkloadsConfig implements IWorkloadsConfig { /** - * Constructs a new ListImageVersionsResponse. + * Constructs a new WorkloadsConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig); - /** ListImageVersionsResponse imageVersions. */ - public imageVersions: google.cloud.orchestration.airflow.service.v1.IImageVersion[]; + /** WorkloadsConfig scheduler. */ + public scheduler?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null); - /** ListImageVersionsResponse nextPageToken. */ - public nextPageToken: string; + /** WorkloadsConfig webServer. */ + public webServer?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker. */ + public worker?: (google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null); /** - * Creates a new ListImageVersionsResponse instance using the specified properties. + * Creates a new WorkloadsConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListImageVersionsResponse instance + * @returns WorkloadsConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; /** - * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. - * @param message ListImageVersionsResponse message or plain object to encode + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. - * @param message ListImageVersionsResponse message or plain object to encode + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer. + * Decodes a WorkloadsConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListImageVersionsResponse + * @returns WorkloadsConfig * @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.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListImageVersionsResponse + * @returns WorkloadsConfig * @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.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; /** - * Verifies a ListImageVersionsResponse message. + * Verifies a WorkloadsConfig 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 ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListImageVersionsResponse + * @returns WorkloadsConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig; /** - * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. - * @param message ListImageVersionsResponse + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * @param message WorkloadsConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListImageVersionsResponse to JSON. + * Converts this WorkloadsConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListImageVersionsResponse + * Gets the default type url for WorkloadsConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImageVersion. */ - interface IImageVersion { + namespace WorkloadsConfig { - /** ImageVersion imageVersionId */ - imageVersionId?: (string|null); + /** Properties of a SchedulerResource. */ + interface ISchedulerResource { - /** ImageVersion isDefault */ - isDefault?: (boolean|null); + /** SchedulerResource cpu */ + cpu?: (number|null); - /** ImageVersion supportedPythonVersions */ - supportedPythonVersions?: (string[]|null); + /** SchedulerResource memoryGb */ + memoryGb?: (number|null); - /** ImageVersion releaseDate */ - releaseDate?: (google.type.IDate|null); + /** SchedulerResource storageGb */ + storageGb?: (number|null); - /** ImageVersion creationDisabled */ - creationDisabled?: (boolean|null); + /** SchedulerResource count */ + count?: (number|null); + } - /** ImageVersion upgradeDisabled */ - upgradeDisabled?: (boolean|null); - } + /** Represents a SchedulerResource. */ + class SchedulerResource implements ISchedulerResource { - /** Represents an ImageVersion. */ - class ImageVersion implements IImageVersion { + /** + * Constructs a new SchedulerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource); - /** - * Constructs a new ImageVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion); + /** SchedulerResource cpu. */ + public cpu: number; - /** ImageVersion imageVersionId. */ - public imageVersionId: string; + /** SchedulerResource memoryGb. */ + public memoryGb: number; - /** ImageVersion isDefault. */ - public isDefault: boolean; + /** SchedulerResource storageGb. */ + public storageGb: number; - /** ImageVersion supportedPythonVersions. */ - public supportedPythonVersions: string[]; + /** SchedulerResource count. */ + public count: number; - /** ImageVersion releaseDate. */ - public releaseDate?: (google.type.IDate|null); + /** + * Creates a new SchedulerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; - /** ImageVersion creationDisabled. */ - public creationDisabled: boolean; + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageVersion upgradeDisabled. */ - public upgradeDisabled: boolean; + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new ImageVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageVersion instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion): google.cloud.orchestration.airflow.service.v1.ImageVersion; + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; - /** - * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. - * @param message ImageVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; - /** - * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. - * @param message ImageVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a SchedulerResource 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 an ImageVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageVersion - * @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.orchestration.airflow.service.v1.ImageVersion; + /** + * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource; - /** - * Decodes an ImageVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageVersion - * @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.orchestration.airflow.service.v1.ImageVersion; + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @param message SchedulerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies an ImageVersion 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 SchedulerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ImageVersion; + /** + * Gets the default type url for SchedulerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. - * @param message ImageVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.ImageVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a WebServerResource. */ + interface IWebServerResource { - /** - * Converts this ImageVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** WebServerResource cpu */ + cpu?: (number|null); - /** - * Gets the default type url for ImageVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** WebServerResource memoryGb */ + memoryGb?: (number|null); - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { + /** WebServerResource storageGb */ + storageGb?: (number|null); + } - /** OperationMetadata state */ - state?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null); + /** Represents a WebServerResource. */ + class WebServerResource implements IWebServerResource { - /** OperationMetadata operationType */ - operationType?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null); + /** + * Constructs a new WebServerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource); - /** OperationMetadata resource */ - resource?: (string|null); + /** WebServerResource cpu. */ + public cpu: number; - /** OperationMetadata resourceUuid */ - resourceUuid?: (string|null); + /** WebServerResource memoryGb. */ + public memoryGb: number; - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** WebServerResource storageGb. */ + public storageGb: number; - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } + /** + * Creates a new WebServerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WebServerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata); + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; - /** OperationMetadata state. */ - public state: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State); + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebServerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; - /** OperationMetadata operationType. */ - public operationType: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type); + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebServerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; - /** OperationMetadata resource. */ - public resource: string; + /** + * Verifies a WebServerResource 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); - /** OperationMetadata resourceUuid. */ - public resourceUuid: string; + /** + * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebServerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource; - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @param message WebServerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this WebServerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + /** + * Gets the default type url for WebServerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + /** Properties of a WorkerResource. */ + interface IWorkerResource { + + /** WorkerResource cpu */ + cpu?: (number|null); + + /** WorkerResource memoryGb */ + memoryGb?: (number|null); + + /** WorkerResource storageGb */ + storageGb?: (number|null); + + /** WorkerResource minCount */ + minCount?: (number|null); + + /** WorkerResource maxCount */ + maxCount?: (number|null); + } + + /** Represents a WorkerResource. */ + class WorkerResource implements IWorkerResource { + + /** + * Constructs a new WorkerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource); + + /** WorkerResource cpu. */ + public cpu: number; + + /** WorkerResource memoryGb. */ + public memoryGb: number; + + /** WorkerResource storageGb. */ + public storageGb: number; + + /** WorkerResource minCount. */ + public minCount: number; + + /** WorkerResource maxCount. */ + public maxCount: number; + + /** + * Creates a new WorkerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerResource + * @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.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Verifies a WorkerResource 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 WorkerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @param message WorkerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RecoveryConfig. */ + interface IRecoveryConfig { + + /** RecoveryConfig scheduledSnapshotsConfig */ + scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + } + + /** Represents a RecoveryConfig. */ + class RecoveryConfig implements IRecoveryConfig { + + /** + * Constructs a new RecoveryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig); + + /** RecoveryConfig scheduledSnapshotsConfig. */ + public scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null); + + /** + * Creates a new RecoveryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecoveryConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; + + /** + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a RecoveryConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns RecoveryConfig * @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.orchestration.airflow.service.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns RecoveryConfig * @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.orchestration.airflow.service.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; /** - * Verifies an OperationMetadata message. + * Verifies a RecoveryConfig 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns RecoveryConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.RecoveryConfig; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. + * @param message RecoveryConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.RecoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this RecoveryConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for RecoveryConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace OperationMetadata { + /** Properties of a ScheduledSnapshotsConfig. */ + interface IScheduledSnapshotsConfig { - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - RUNNING = 2, - SUCCEEDED = 3, - SUCCESSFUL = 3, - FAILED = 4 - } + /** ScheduledSnapshotsConfig enabled */ + enabled?: (boolean|null); - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - CREATE = 1, - DELETE = 2, - UPDATE = 3, - CHECK = 4 - } - } - } + /** ScheduledSnapshotsConfig snapshotLocation */ + snapshotLocation?: (string|null); - /** Namespace v1beta1. */ - namespace v1beta1 { + /** ScheduledSnapshotsConfig snapshotCreationSchedule */ + snapshotCreationSchedule?: (string|null); - /** Represents an Environments */ - class Environments extends $protobuf.rpc.Service { + /** ScheduledSnapshotsConfig timeZone */ + timeZone?: (string|null); + } - /** - * Constructs a new Environments 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); + /** Represents a ScheduledSnapshotsConfig. */ + class ScheduledSnapshotsConfig implements IScheduledSnapshotsConfig { /** - * Creates new Environments 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. + * Constructs a new ScheduledSnapshotsConfig. + * @param [properties] Properties to set */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig); - /** - * Calls CreateEnvironment. - * @param request CreateEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback): void; + /** ScheduledSnapshotsConfig enabled. */ + public enabled: boolean; - /** - * Calls CreateEnvironment. - * @param request CreateEnvironmentRequest message or plain object - * @returns Promise - */ - public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): Promise; + /** ScheduledSnapshotsConfig snapshotLocation. */ + public snapshotLocation: string; + + /** ScheduledSnapshotsConfig snapshotCreationSchedule. */ + public snapshotCreationSchedule: string; + + /** ScheduledSnapshotsConfig timeZone. */ + public timeZone: string; /** - * Calls GetEnvironment. - * @param request GetEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Environment + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduledSnapshotsConfig instance */ - public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback): void; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; /** - * Calls GetEnvironment. - * @param request GetEnvironmentRequest message or plain object - * @returns Promise + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): Promise; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback): void; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @returns Promise + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; /** - * Calls UpdateEnvironment. - * @param request UpdateEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; /** - * Calls UpdateEnvironment. - * @param request UpdateEnvironmentRequest message or plain object - * @returns Promise + * Verifies a ScheduledSnapshotsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteEnvironment. - * @param request DeleteEnvironmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScheduledSnapshotsConfig */ - public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig; /** - * Calls DeleteEnvironment. - * @param request DeleteEnvironmentRequest message or plain object - * @returns Promise + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * @param message ScheduledSnapshotsConfig + * @param [options] Conversion options + * @returns Plain object */ - public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): Promise; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls RestartWebServer. - * @param request RestartWebServerRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this ScheduledSnapshotsConfig to JSON. + * @returns JSON object */ - public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls RestartWebServer. - * @param request RestartWebServerRequest message or plain object - * @returns Promise - */ - public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): Promise; - - /** - * Calls CheckUpgrade. - * @param request CheckUpgradeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback): void; - - /** - * Calls CheckUpgrade. - * @param request CheckUpgradeRequest message or plain object - * @returns Promise - */ - public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest): Promise; - } - - namespace Environments { - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. - * @param error Error, if any - * @param [response] Environment - */ - type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.Environment) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. - * @param error Error, if any - * @param [response] ListEnvironmentsResponse - */ - type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. - * @param error Error, if any - * @param [response] Operation - */ - type RestartWebServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for ScheduledSnapshotsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type CheckUpgradeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateEnvironmentRequest. */ - interface ICreateEnvironmentRequest { + /** Properties of a MasterAuthorizedNetworksConfig. */ + interface IMasterAuthorizedNetworksConfig { - /** CreateEnvironmentRequest parent */ - parent?: (string|null); + /** MasterAuthorizedNetworksConfig enabled */ + enabled?: (boolean|null); - /** CreateEnvironmentRequest environment */ - environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** MasterAuthorizedNetworksConfig cidrBlocks */ + cidrBlocks?: (google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]|null); } - /** Represents a CreateEnvironmentRequest. */ - class CreateEnvironmentRequest implements ICreateEnvironmentRequest { + /** Represents a MasterAuthorizedNetworksConfig. */ + class MasterAuthorizedNetworksConfig implements IMasterAuthorizedNetworksConfig { /** - * Constructs a new CreateEnvironmentRequest. + * Constructs a new MasterAuthorizedNetworksConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig); - /** CreateEnvironmentRequest parent. */ - public parent: string; + /** MasterAuthorizedNetworksConfig enabled. */ + public enabled: boolean; - /** CreateEnvironmentRequest environment. */ - public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** MasterAuthorizedNetworksConfig cidrBlocks. */ + public cidrBlocks: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock[]; /** - * Creates a new CreateEnvironmentRequest instance using the specified properties. + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. * @param [properties] Properties to set - * @returns CreateEnvironmentRequest instance + * @returns MasterAuthorizedNetworksConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; /** - * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. - * @param message CreateEnvironmentRequest message or plain object to encode + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. - * @param message CreateEnvironmentRequest message or plain object to encode + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateEnvironmentRequest + * @returns MasterAuthorizedNetworksConfig * @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.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateEnvironmentRequest + * @returns MasterAuthorizedNetworksConfig * @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.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; /** - * Verifies a CreateEnvironmentRequest message. + * Verifies a MasterAuthorizedNetworksConfig 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 CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateEnvironmentRequest + * @returns MasterAuthorizedNetworksConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig; /** - * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. - * @param message CreateEnvironmentRequest + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. + * @param message MasterAuthorizedNetworksConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateEnvironmentRequest to JSON. + * Converts this MasterAuthorizedNetworksConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateEnvironmentRequest + * Gets the default type url for MasterAuthorizedNetworksConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetEnvironmentRequest. */ - interface IGetEnvironmentRequest { + namespace MasterAuthorizedNetworksConfig { - /** GetEnvironmentRequest name */ + /** Properties of a CidrBlock. */ + interface ICidrBlock { + + /** CidrBlock displayName */ + displayName?: (string|null); + + /** CidrBlock cidrBlock */ + cidrBlock?: (string|null); + } + + /** Represents a CidrBlock. */ + class CidrBlock implements ICidrBlock { + + /** + * Constructs a new CidrBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock); + + /** CidrBlock displayName. */ + public displayName: string; + + /** CidrBlock cidrBlock. */ + public cidrBlock: string; + + /** + * Creates a new CidrBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns CidrBlock instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CidrBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CidrBlock + * @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.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CidrBlock + * @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.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Verifies a CidrBlock 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 CidrBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CidrBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock; + + /** + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. + * @param message CidrBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CidrBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CidrBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ name?: (string|null); + + /** Environment config */ + config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + + /** Environment uuid */ + uuid?: (string|null); + + /** Environment state */ + state?: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State|null); + + /** Environment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels */ + labels?: ({ [k: string]: string }|null); } - /** Represents a GetEnvironmentRequest. */ - class GetEnvironmentRequest implements IGetEnvironmentRequest { + /** Represents an Environment. */ + class Environment implements IEnvironment { /** - * Constructs a new GetEnvironmentRequest. + * Constructs a new Environment. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment); - /** GetEnvironmentRequest name. */ + /** Environment name. */ public name: string; + /** Environment config. */ + public config?: (google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null); + + /** Environment uuid. */ + public uuid: string; + + /** Environment state. */ + public state: (google.cloud.orchestration.airflow.service.v1.Environment.State|keyof typeof google.cloud.orchestration.airflow.service.v1.Environment.State); + + /** Environment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Environment labels. */ + public labels: { [k: string]: string }; + /** - * Creates a new GetEnvironmentRequest instance using the specified properties. + * Creates a new Environment instance using the specified properties. * @param [properties] Properties to set - * @returns GetEnvironmentRequest instance + * @returns Environment instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IEnvironment): google.cloud.orchestration.airflow.service.v1.Environment; /** - * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. - * @param message GetEnvironmentRequest message or plain object to encode + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. - * @param message GetEnvironmentRequest message or plain object to encode + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * Decodes an Environment message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetEnvironmentRequest + * @returns Environment * @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.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.Environment; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes an Environment message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetEnvironmentRequest + * @returns Environment * @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.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.Environment; /** - * Verifies a GetEnvironmentRequest message. + * Verifies an Environment 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 GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an Environment message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetEnvironmentRequest + * @returns Environment */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.Environment; /** - * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. - * @param message GetEnvironmentRequest + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetEnvironmentRequest to JSON. + * Converts this Environment to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetEnvironmentRequest + * Gets the default type url for Environment * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListEnvironmentsRequest. */ - interface IListEnvironmentsRequest { + namespace Environment { - /** ListEnvironmentsRequest parent */ - parent?: (string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + RUNNING = 2, + UPDATING = 3, + DELETING = 4, + ERROR = 5 + } + } - /** ListEnvironmentsRequest pageSize */ - pageSize?: (number|null); + /** Properties of a CheckUpgradeResponse. */ + interface ICheckUpgradeResponse { - /** ListEnvironmentsRequest pageToken */ - pageToken?: (string|null); + /** CheckUpgradeResponse buildLogUri */ + buildLogUri?: (string|null); + + /** CheckUpgradeResponse containsPypiModulesConflict */ + containsPypiModulesConflict?: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null); + + /** CheckUpgradeResponse pypiConflictBuildLogExtract */ + pypiConflictBuildLogExtract?: (string|null); + + /** CheckUpgradeResponse imageVersion */ + imageVersion?: (string|null); + + /** CheckUpgradeResponse pypiDependencies */ + pypiDependencies?: ({ [k: string]: string }|null); } - /** Represents a ListEnvironmentsRequest. */ - class ListEnvironmentsRequest implements IListEnvironmentsRequest { + /** Represents a CheckUpgradeResponse. */ + class CheckUpgradeResponse implements ICheckUpgradeResponse { /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new CheckUpgradeResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse); - /** ListEnvironmentsRequest parent. */ - public parent: string; + /** CheckUpgradeResponse buildLogUri. */ + public buildLogUri: string; - /** ListEnvironmentsRequest pageSize. */ - public pageSize: number; + /** CheckUpgradeResponse containsPypiModulesConflict. */ + public containsPypiModulesConflict: (google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|keyof typeof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult); - /** ListEnvironmentsRequest pageToken. */ - public pageToken: string; + /** CheckUpgradeResponse pypiConflictBuildLogExtract. */ + public pypiConflictBuildLogExtract: string; + + /** CheckUpgradeResponse imageVersion. */ + public imageVersion: string; + + /** CheckUpgradeResponse pypiDependencies. */ + public pypiDependencies: { [k: string]: string }; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * Creates a new CheckUpgradeResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsRequest instance + * @returns CheckUpgradeResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @param message CheckUpgradeResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * @param message CheckUpgradeResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a CheckUpgradeResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsRequest + * @returns CheckUpgradeResponse * @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.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsRequest + * @returns CheckUpgradeResponse * @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.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a CheckUpgradeResponse 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 ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsRequest + * @returns CheckUpgradeResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @param message ListEnvironmentsRequest + * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. + * @param message CheckUpgradeResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this CheckUpgradeResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListEnvironmentsRequest + * Gets the default type url for CheckUpgradeResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListEnvironmentsResponse. */ - interface IListEnvironmentsResponse { + namespace CheckUpgradeResponse { - /** ListEnvironmentsResponse environments */ - environments?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null); + /** ConflictResult enum. */ + enum ConflictResult { + CONFLICT_RESULT_UNSPECIFIED = 0, + CONFLICT = 1, + NO_CONFLICT = 2 + } + } - /** ListEnvironmentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Represents an ImageVersions */ + class ImageVersions extends $protobuf.rpc.Service { + + /** + * Constructs a new ImageVersions 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 ImageVersions 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): ImageVersions; + + /** + * Calls ListImageVersions. + * @param request ListImageVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListImageVersionsResponse + */ + public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, callback: google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback): void; + + /** + * Calls ListImageVersions. + * @param request ListImageVersionsRequest message or plain object + * @returns Promise + */ + public listImageVersions(request: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): Promise; } - /** Represents a ListEnvironmentsResponse. */ - class ListEnvironmentsResponse implements IListEnvironmentsResponse { + namespace ImageVersions { /** - * Constructs a new ListEnvironmentsResponse. + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. + * @param error Error, if any + * @param [response] ListImageVersionsResponse + */ + type ListImageVersionsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) => void; + } + + /** Properties of a ListImageVersionsRequest. */ + interface IListImageVersionsRequest { + + /** ListImageVersionsRequest parent */ + parent?: (string|null); + + /** ListImageVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListImageVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListImageVersionsRequest includePastReleases */ + includePastReleases?: (boolean|null); + } + + /** Represents a ListImageVersionsRequest. */ + class ListImageVersionsRequest implements IListImageVersionsRequest { + + /** + * Constructs a new ListImageVersionsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest); - /** ListEnvironmentsResponse environments. */ - public environments: google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]; + /** ListImageVersionsRequest parent. */ + public parent: string; - /** ListEnvironmentsResponse nextPageToken. */ - public nextPageToken: string; + /** ListImageVersionsRequest pageSize. */ + public pageSize: number; + + /** ListImageVersionsRequest pageToken. */ + public pageToken: string; + + /** ListImageVersionsRequest includePastReleases. */ + public includePastReleases: boolean; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * Creates a new ListImageVersionsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsResponse instance + * @returns ListImageVersionsRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * @param message ListImageVersionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * @param message ListImageVersionsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsResponse + * @returns ListImageVersionsRequest * @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.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsResponse + * @returns ListImageVersionsRequest * @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.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies a ListImageVersionsRequest 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 ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsResponse + * @returns ListImageVersionsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @param message ListEnvironmentsResponse + * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. + * @param message ListImageVersionsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this ListImageVersionsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListEnvironmentsResponse + * Gets the default type url for ListImageVersionsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteEnvironmentRequest. */ - interface IDeleteEnvironmentRequest { + /** Properties of a ListImageVersionsResponse. */ + interface IListImageVersionsResponse { - /** DeleteEnvironmentRequest name */ - name?: (string|null); + /** ListImageVersionsResponse imageVersions */ + imageVersions?: (google.cloud.orchestration.airflow.service.v1.IImageVersion[]|null); + + /** ListImageVersionsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a DeleteEnvironmentRequest. */ - class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { + /** Represents a ListImageVersionsResponse. */ + class ListImageVersionsResponse implements IListImageVersionsResponse { /** - * Constructs a new DeleteEnvironmentRequest. + * Constructs a new ListImageVersionsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse); - /** DeleteEnvironmentRequest name. */ - public name: string; + /** ListImageVersionsResponse imageVersions. */ + public imageVersions: google.cloud.orchestration.airflow.service.v1.IImageVersion[]; + + /** ListImageVersionsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * Creates a new ListImageVersionsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteEnvironmentRequest instance + * @returns ListImageVersionsResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; /** - * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @param message DeleteEnvironmentRequest message or plain object to encode + * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * @param message ListImageVersionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @param message DeleteEnvironmentRequest message or plain object to encode + * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * @param message ListImageVersionsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * Decodes a ListImageVersionsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteEnvironmentRequest + * @returns ListImageVersionsResponse * @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.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteEnvironmentRequest + * @returns ListImageVersionsResponse * @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.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; /** - * Verifies a DeleteEnvironmentRequest message. + * Verifies a ListImageVersionsResponse 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 DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteEnvironmentRequest + * @returns ListImageVersionsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse; /** - * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. - * @param message DeleteEnvironmentRequest + * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. + * @param message ListImageVersionsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteEnvironmentRequest to JSON. + * Converts this ListImageVersionsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteEnvironmentRequest + * Gets the default type url for ListImageVersionsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateEnvironmentRequest. */ - interface IUpdateEnvironmentRequest { + /** Properties of an ImageVersion. */ + interface IImageVersion { - /** UpdateEnvironmentRequest name */ - name?: (string|null); + /** ImageVersion imageVersionId */ + imageVersionId?: (string|null); - /** UpdateEnvironmentRequest environment */ - environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** ImageVersion isDefault */ + isDefault?: (boolean|null); - /** UpdateEnvironmentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ImageVersion supportedPythonVersions */ + supportedPythonVersions?: (string[]|null); + + /** ImageVersion releaseDate */ + releaseDate?: (google.type.IDate|null); + + /** ImageVersion creationDisabled */ + creationDisabled?: (boolean|null); + + /** ImageVersion upgradeDisabled */ + upgradeDisabled?: (boolean|null); } - /** Represents an UpdateEnvironmentRequest. */ - class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { + /** Represents an ImageVersion. */ + class ImageVersion implements IImageVersion { /** - * Constructs a new UpdateEnvironmentRequest. + * Constructs a new ImageVersion. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion); - /** UpdateEnvironmentRequest name. */ - public name: string; + /** ImageVersion imageVersionId. */ + public imageVersionId: string; - /** UpdateEnvironmentRequest environment. */ - public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + /** ImageVersion isDefault. */ + public isDefault: boolean; - /** UpdateEnvironmentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ImageVersion supportedPythonVersions. */ + public supportedPythonVersions: string[]; + + /** ImageVersion releaseDate. */ + public releaseDate?: (google.type.IDate|null); + + /** ImageVersion creationDisabled. */ + public creationDisabled: boolean; + + /** ImageVersion upgradeDisabled. */ + public upgradeDisabled: boolean; /** - * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * Creates a new ImageVersion instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateEnvironmentRequest instance + * @returns ImageVersion instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IImageVersion): google.cloud.orchestration.airflow.service.v1.ImageVersion; /** - * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. - * @param message UpdateEnvironmentRequest message or plain object to encode + * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * @param message ImageVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. - * @param message UpdateEnvironmentRequest message or plain object to encode + * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * @param message ImageVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IImageVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * Decodes an ImageVersion message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateEnvironmentRequest + * @returns ImageVersion * @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.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.ImageVersion; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes an ImageVersion message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateEnvironmentRequest + * @returns ImageVersion * @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.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.ImageVersion; /** - * Verifies an UpdateEnvironmentRequest message. + * Verifies an ImageVersion 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 UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateEnvironmentRequest + * @returns ImageVersion */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.ImageVersion; /** - * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. - * @param message UpdateEnvironmentRequest + * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. + * @param message ImageVersion * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.ImageVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateEnvironmentRequest to JSON. + * Converts this ImageVersion to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateEnvironmentRequest + * Gets the default type url for ImageVersion * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestartWebServerRequest. */ - interface IRestartWebServerRequest { + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { - /** RestartWebServerRequest name */ - name?: (string|null); + /** OperationMetadata state */ + state?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null); + + /** OperationMetadata operationType */ + operationType?: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null); + + /** OperationMetadata resource */ + resource?: (string|null); + + /** OperationMetadata resourceUuid */ + resourceUuid?: (string|null); + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); } - /** Represents a RestartWebServerRequest. */ - class RestartWebServerRequest implements IRestartWebServerRequest { + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { /** - * Constructs a new RestartWebServerRequest. + * Constructs a new OperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest); + constructor(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata); - /** RestartWebServerRequest name. */ - public name: string; + /** OperationMetadata state. */ + public state: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.State); + + /** OperationMetadata operationType. */ + public operationType: (google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|keyof typeof google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type); + + /** OperationMetadata resource. */ + public resource: string; + + /** OperationMetadata resourceUuid. */ + public resourceUuid: string; + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new RestartWebServerRequest instance using the specified properties. + * Creates a new OperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RestartWebServerRequest instance + * @returns OperationMetadata instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static create(properties?: google.cloud.orchestration.airflow.service.v1.IOperationMetadata): google.cloud.orchestration.airflow.service.v1.OperationMetadata; /** - * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @param message RestartWebServerRequest message or plain object to encode + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. - * @param message RestartWebServerRequest message or plain object to encode + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * Decodes an OperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestartWebServerRequest + * @returns OperationMetadata * @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.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1.OperationMetadata; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestartWebServerRequest + * @returns OperationMetadata * @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.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1.OperationMetadata; /** - * Verifies a RestartWebServerRequest message. + * Verifies an OperationMetadata 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 RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestartWebServerRequest + * @returns OperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1.OperationMetadata; /** - * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. - * @param message RestartWebServerRequest + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestartWebServerRequest to JSON. + * Converts this OperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RestartWebServerRequest + * Gets the default type url for OperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EnvironmentConfig. */ - interface IEnvironmentConfig { - - /** EnvironmentConfig gkeCluster */ - gkeCluster?: (string|null); - - /** EnvironmentConfig dagGcsPrefix */ - dagGcsPrefix?: (string|null); - - /** EnvironmentConfig nodeCount */ - nodeCount?: (number|null); - - /** EnvironmentConfig softwareConfig */ - softwareConfig?: (google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null); - - /** EnvironmentConfig nodeConfig */ - nodeConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null); - - /** EnvironmentConfig privateEnvironmentConfig */ - privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null); - - /** EnvironmentConfig webServerNetworkAccessControl */ - webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null); - - /** EnvironmentConfig databaseConfig */ - databaseConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null); - - /** EnvironmentConfig webServerConfig */ - webServerConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null); - - /** EnvironmentConfig airflowUri */ - airflowUri?: (string|null); - - /** EnvironmentConfig encryptionConfig */ - encryptionConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null); - - /** EnvironmentConfig maintenanceWindow */ - maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null); + namespace OperationMetadata { - /** EnvironmentConfig workloadsConfig */ - workloadsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + SUCCEEDED = 3, + SUCCESSFUL = 3, + FAILED = 4 + } - /** EnvironmentConfig environmentSize */ - environmentSize?: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|null); + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CREATE = 1, + DELETE = 2, + UPDATE = 3, + CHECK = 4, + SAVE_SNAPSHOT = 5, + LOAD_SNAPSHOT = 6 + } } + } - /** Represents an EnvironmentConfig. */ - class EnvironmentConfig implements IEnvironmentConfig { + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { /** - * Constructs a new EnvironmentConfig. - * @param [properties] Properties to set + * Constructs a new Environments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig); - - /** EnvironmentConfig gkeCluster. */ - public gkeCluster: string; - - /** EnvironmentConfig dagGcsPrefix. */ - public dagGcsPrefix: string; - - /** EnvironmentConfig nodeCount. */ - public nodeCount: number; - - /** EnvironmentConfig softwareConfig. */ - public softwareConfig?: (google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null); - - /** EnvironmentConfig nodeConfig. */ - public nodeConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null); - - /** EnvironmentConfig privateEnvironmentConfig. */ - public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null); - - /** EnvironmentConfig webServerNetworkAccessControl. */ - public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null); - - /** EnvironmentConfig databaseConfig. */ - public databaseConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null); - - /** EnvironmentConfig webServerConfig. */ - public webServerConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null); - - /** EnvironmentConfig airflowUri. */ - public airflowUri: string; - - /** EnvironmentConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null); - - /** EnvironmentConfig maintenanceWindow. */ - public maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null); - - /** EnvironmentConfig workloadsConfig. */ - public workloadsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** EnvironmentConfig environmentSize. */ - public environmentSize: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize); + /** + * Creates new Environments 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): Environments; /** - * Creates a new EnvironmentConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvironmentConfig instance + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback): void; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateEnvironment. + * @param request CreateEnvironmentRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public createEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): Promise; /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Environment */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback): void; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetEnvironment. + * @param request GetEnvironmentRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + public getEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): Promise; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback): void; /** - * Verifies an EnvironmentConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listEnvironments(request: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): Promise; /** - * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvironmentConfig + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback): void; /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. - * @param message EnvironmentConfig - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateEnvironment. + * @param request UpdateEnvironmentRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): Promise; /** - * Converts this EnvironmentConfig to JSON. - * @returns JSON object + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; + public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback): void; /** - * Gets the default type url for EnvironmentConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls DeleteEnvironment. + * @param request DeleteEnvironmentRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public deleteEnvironment(request: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): Promise; - namespace EnvironmentConfig { + /** + * Calls RestartWebServer. + * @param request RestartWebServerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback): void; - /** EnvironmentSize enum. */ - enum EnvironmentSize { - ENVIRONMENT_SIZE_UNSPECIFIED = 0, - ENVIRONMENT_SIZE_SMALL = 1, - ENVIRONMENT_SIZE_MEDIUM = 2, - ENVIRONMENT_SIZE_LARGE = 3 - } + /** + * Calls RestartWebServer. + * @param request RestartWebServerRequest message or plain object + * @returns Promise + */ + public restartWebServer(request: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): Promise; + + /** + * Calls CheckUpgrade. + * @param request CheckUpgradeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback): void; + + /** + * Calls CheckUpgrade. + * @param request CheckUpgradeRequest message or plain object + * @returns Promise + */ + public checkUpgrade(request: google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest): Promise; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback): void; + + /** + * Calls SaveSnapshot. + * @param request SaveSnapshotRequest message or plain object + * @returns Promise + */ + public saveSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): Promise; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, callback: google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback): void; + + /** + * Calls LoadSnapshot. + * @param request LoadSnapshotRequest message or plain object + * @returns Promise + */ + public loadSnapshot(request: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): Promise; } - /** Properties of a WebServerNetworkAccessControl. */ - interface IWebServerNetworkAccessControl { + namespace Environments { - /** WebServerNetworkAccessControl allowedIpRanges */ - allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. + * @param error Error, if any + * @param [response] Environment + */ + type GetEnvironmentCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.Environment) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteEnvironmentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartWebServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. + * @param error Error, if any + * @param [response] Operation + */ + type CheckUpgradeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type SaveSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type LoadSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Represents a WebServerNetworkAccessControl. */ - class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { + /** Properties of a CreateEnvironmentRequest. */ + interface ICreateEnvironmentRequest { + + /** CreateEnvironmentRequest parent */ + parent?: (string|null); + + /** CreateEnvironmentRequest environment */ + environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); + } + + /** Represents a CreateEnvironmentRequest. */ + class CreateEnvironmentRequest implements ICreateEnvironmentRequest { /** - * Constructs a new WebServerNetworkAccessControl. + * Constructs a new CreateEnvironmentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest); - /** WebServerNetworkAccessControl allowedIpRanges. */ - public allowedIpRanges: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange[]; + /** CreateEnvironmentRequest parent. */ + public parent: string; + + /** CreateEnvironmentRequest environment. */ + public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * Creates a new CreateEnvironmentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerNetworkAccessControl instance + * @returns CreateEnvironmentRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. - * @param message WebServerNetworkAccessControl message or plain object to encode + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * @param message CreateEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerNetworkAccessControl + * @returns CreateEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerNetworkAccessControl + * @returns CreateEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; /** - * Verifies a WebServerNetworkAccessControl message. + * Verifies a CreateEnvironmentRequest 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 WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerNetworkAccessControl + * @returns CreateEnvironmentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest; /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. - * @param message WebServerNetworkAccessControl + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * @param message CreateEnvironmentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerNetworkAccessControl to JSON. + * Converts this CreateEnvironmentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerNetworkAccessControl + * Gets the default type url for CreateEnvironmentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace WebServerNetworkAccessControl { - - /** Properties of an AllowedIpRange. */ - interface IAllowedIpRange { + /** Properties of a GetEnvironmentRequest. */ + interface IGetEnvironmentRequest { - /** AllowedIpRange value */ - value?: (string|null); + /** GetEnvironmentRequest name */ + name?: (string|null); + } - /** AllowedIpRange description */ - description?: (string|null); - } + /** Represents a GetEnvironmentRequest. */ + class GetEnvironmentRequest implements IGetEnvironmentRequest { - /** Represents an AllowedIpRange. */ - class AllowedIpRange implements IAllowedIpRange { + /** + * Constructs a new GetEnvironmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest); - /** - * Constructs a new AllowedIpRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange); + /** GetEnvironmentRequest name. */ + public name: string; - /** AllowedIpRange value. */ - public value: string; + /** + * Creates a new GetEnvironmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEnvironmentRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; - /** AllowedIpRange description. */ - public description: string; + /** + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new AllowedIpRange instance using the specified properties. - * @param [properties] Properties to set - * @returns AllowedIpRange instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * @param message GetEnvironmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEnvironmentRequest + * @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.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; - /** - * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @param message AllowedIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllowedIpRange - * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllowedIpRange - * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEnvironmentRequest + * @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.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; - /** - * Verifies an AllowedIpRange 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); + /** + * Verifies a GetEnvironmentRequest 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 AllowedIpRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllowedIpRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + /** + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEnvironmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest; - /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. - * @param message AllowedIpRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * @param message GetEnvironmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this AllowedIpRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this GetEnvironmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for AllowedIpRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for GetEnvironmentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SoftwareConfig. */ - interface ISoftwareConfig { - - /** SoftwareConfig imageVersion */ - imageVersion?: (string|null); - - /** SoftwareConfig airflowConfigOverrides */ - airflowConfigOverrides?: ({ [k: string]: string }|null); + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { - /** SoftwareConfig pypiPackages */ - pypiPackages?: ({ [k: string]: string }|null); + /** ListEnvironmentsRequest parent */ + parent?: (string|null); - /** SoftwareConfig envVariables */ - envVariables?: ({ [k: string]: string }|null); + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); - /** SoftwareConfig pythonVersion */ - pythonVersion?: (string|null); + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a SoftwareConfig. */ - class SoftwareConfig implements ISoftwareConfig { + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { /** - * Constructs a new SoftwareConfig. + * Constructs a new ListEnvironmentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig); - - /** SoftwareConfig imageVersion. */ - public imageVersion: string; - - /** SoftwareConfig airflowConfigOverrides. */ - public airflowConfigOverrides: { [k: string]: string }; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest); - /** SoftwareConfig pypiPackages. */ - public pypiPackages: { [k: string]: string }; + /** ListEnvironmentsRequest parent. */ + public parent: string; - /** SoftwareConfig envVariables. */ - public envVariables: { [k: string]: string }; + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; - /** SoftwareConfig pythonVersion. */ - public pythonVersion: string; + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new ListEnvironmentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SoftwareConfig instance + * @returns ListEnvironmentsRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SoftwareConfig + * @returns ListEnvironmentsRequest * @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.orchestration.airflow.service.v1beta1.SoftwareConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SoftwareConfig + * @returns ListEnvironmentsRequest * @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.orchestration.airflow.service.v1beta1.SoftwareConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; /** - * Verifies a SoftwareConfig message. + * Verifies a ListEnvironmentsRequest 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 SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SoftwareConfig + * @returns ListEnvironmentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. - * @param message SoftwareConfig + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SoftwareConfig to JSON. + * Converts this ListEnvironmentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for ListEnvironmentsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a IPAllocationPolicy. */ - interface IIPAllocationPolicy { - - /** IPAllocationPolicy useIpAliases */ - useIpAliases?: (boolean|null); - - /** IPAllocationPolicy clusterSecondaryRangeName */ - clusterSecondaryRangeName?: (string|null); - - /** IPAllocationPolicy servicesSecondaryRangeName */ - servicesSecondaryRangeName?: (string|null); + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { - /** IPAllocationPolicy clusterIpv4CidrBlock */ - clusterIpv4CidrBlock?: (string|null); + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]|null); - /** IPAllocationPolicy servicesIpv4CidrBlock */ - servicesIpv4CidrBlock?: (string|null); + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a IPAllocationPolicy. */ - class IPAllocationPolicy implements IIPAllocationPolicy { + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { /** - * Constructs a new IPAllocationPolicy. + * Constructs a new ListEnvironmentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy); - - /** IPAllocationPolicy useIpAliases. */ - public useIpAliases: boolean; - - /** IPAllocationPolicy clusterSecondaryRangeName. */ - public clusterSecondaryRangeName: string; - - /** IPAllocationPolicy servicesSecondaryRangeName. */ - public servicesSecondaryRangeName: string; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse); - /** IPAllocationPolicy clusterIpv4CidrBlock. */ - public clusterIpv4CidrBlock: string; + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.orchestration.airflow.service.v1beta1.IEnvironment[]; - /** IPAllocationPolicy servicesIpv4CidrBlock. */ - public servicesIpv4CidrBlock: string; + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new IPAllocationPolicy instance using the specified properties. + * Creates a new ListEnvironmentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns IPAllocationPolicy instance + * @returns ListEnvironmentsResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. - * @param message IPAllocationPolicy message or plain object to encode + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns IPAllocationPolicy + * @returns ListEnvironmentsResponse * @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.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns IPAllocationPolicy + * @returns ListEnvironmentsResponse * @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.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; /** - * Verifies a IPAllocationPolicy message. + * Verifies a ListEnvironmentsResponse 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 IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns IPAllocationPolicy + * @returns ListEnvironmentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. - * @param message IPAllocationPolicy + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this ListEnvironmentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for ListEnvironmentsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NodeConfig. */ - interface INodeConfig { - - /** NodeConfig location */ - location?: (string|null); - - /** NodeConfig machineType */ - machineType?: (string|null); - - /** NodeConfig network */ - network?: (string|null); - - /** NodeConfig subnetwork */ - subnetwork?: (string|null); - - /** NodeConfig diskSizeGb */ - diskSizeGb?: (number|null); - - /** NodeConfig oauthScopes */ - oauthScopes?: (string[]|null); - - /** NodeConfig serviceAccount */ - serviceAccount?: (string|null); - - /** NodeConfig tags */ - tags?: (string[]|null); - - /** NodeConfig ipAllocationPolicy */ - ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null); + /** Properties of a DeleteEnvironmentRequest. */ + interface IDeleteEnvironmentRequest { - /** NodeConfig maxPodsPerNode */ - maxPodsPerNode?: (number|null); + /** DeleteEnvironmentRequest name */ + name?: (string|null); } - /** Represents a NodeConfig. */ - class NodeConfig implements INodeConfig { + /** Represents a DeleteEnvironmentRequest. */ + class DeleteEnvironmentRequest implements IDeleteEnvironmentRequest { /** - * Constructs a new NodeConfig. + * Constructs a new DeleteEnvironmentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig); - - /** NodeConfig location. */ - public location: string; - - /** NodeConfig machineType. */ - public machineType: string; - - /** NodeConfig network. */ - public network: string; - - /** NodeConfig subnetwork. */ - public subnetwork: string; - - /** NodeConfig diskSizeGb. */ - public diskSizeGb: number; - - /** NodeConfig oauthScopes. */ - public oauthScopes: string[]; - - /** NodeConfig serviceAccount. */ - public serviceAccount: string; - - /** NodeConfig tags. */ - public tags: string[]; - - /** NodeConfig ipAllocationPolicy. */ - public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest); - /** NodeConfig maxPodsPerNode. */ - public maxPodsPerNode: number; + /** DeleteEnvironmentRequest name. */ + public name: string; /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new DeleteEnvironmentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NodeConfig instance + * @returns DeleteEnvironmentRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig): google.cloud.orchestration.airflow.service.v1beta1.NodeConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. - * @param message NodeConfig message or plain object to encode + * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @param message DeleteEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NodeConfig + * @returns DeleteEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.NodeConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NodeConfig + * @returns DeleteEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.NodeConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; /** - * Verifies a NodeConfig message. + * Verifies a DeleteEnvironmentRequest 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 NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NodeConfig + * @returns DeleteEnvironmentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.NodeConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. - * @param message NodeConfig + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @param message DeleteEnvironmentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NodeConfig to JSON. + * Converts this DeleteEnvironmentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for DeleteEnvironmentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrivateClusterConfig. */ - interface IPrivateClusterConfig { + /** Properties of an UpdateEnvironmentRequest. */ + interface IUpdateEnvironmentRequest { - /** PrivateClusterConfig enablePrivateEndpoint */ - enablePrivateEndpoint?: (boolean|null); + /** UpdateEnvironmentRequest name */ + name?: (string|null); - /** PrivateClusterConfig masterIpv4CidrBlock */ - masterIpv4CidrBlock?: (string|null); + /** UpdateEnvironmentRequest environment */ + environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); - /** PrivateClusterConfig masterIpv4ReservedRange */ - masterIpv4ReservedRange?: (string|null); + /** UpdateEnvironmentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a PrivateClusterConfig. */ - class PrivateClusterConfig implements IPrivateClusterConfig { + /** Represents an UpdateEnvironmentRequest. */ + class UpdateEnvironmentRequest implements IUpdateEnvironmentRequest { /** - * Constructs a new PrivateClusterConfig. + * Constructs a new UpdateEnvironmentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest); - /** PrivateClusterConfig enablePrivateEndpoint. */ - public enablePrivateEndpoint: boolean; + /** UpdateEnvironmentRequest name. */ + public name: string; - /** PrivateClusterConfig masterIpv4CidrBlock. */ - public masterIpv4CidrBlock: string; + /** UpdateEnvironmentRequest environment. */ + public environment?: (google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null); - /** PrivateClusterConfig masterIpv4ReservedRange. */ - public masterIpv4ReservedRange: string; + /** UpdateEnvironmentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * Creates a new UpdateEnvironmentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateClusterConfig instance + * @returns UpdateEnvironmentRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. - * @param message PrivateClusterConfig message or plain object to encode + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @param message UpdateEnvironmentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateClusterConfig + * @returns UpdateEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateClusterConfig + * @returns UpdateEnvironmentRequest * @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.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Verifies a PrivateClusterConfig message. + * Verifies an UpdateEnvironmentRequest 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 PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateClusterConfig + * @returns UpdateEnvironmentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest; /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. - * @param message PrivateClusterConfig + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @param message UpdateEnvironmentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this UpdateEnvironmentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for UpdateEnvironmentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PrivateEnvironmentConfig. */ - interface IPrivateEnvironmentConfig { + /** Properties of a RestartWebServerRequest. */ + interface IRestartWebServerRequest { - /** PrivateEnvironmentConfig enablePrivateEnvironment */ - enablePrivateEnvironment?: (boolean|null); + /** RestartWebServerRequest name */ + name?: (string|null); + } - /** PrivateEnvironmentConfig privateClusterConfig */ - privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null); + /** Represents a RestartWebServerRequest. */ + class RestartWebServerRequest implements IRestartWebServerRequest { - /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ - webServerIpv4CidrBlock?: (string|null); + /** + * Constructs a new RestartWebServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest); - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ - cloudSqlIpv4CidrBlock?: (string|null); - - /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ - webServerIpv4ReservedRange?: (string|null); - - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock */ - cloudComposerNetworkIpv4CidrBlock?: (string|null); - - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange */ - cloudComposerNetworkIpv4ReservedRange?: (string|null); - } - - /** Represents a PrivateEnvironmentConfig. */ - class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { - - /** - * Constructs a new PrivateEnvironmentConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig); - - /** PrivateEnvironmentConfig enablePrivateEnvironment. */ - public enablePrivateEnvironment: boolean; - - /** PrivateEnvironmentConfig privateClusterConfig. */ - public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null); - - /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ - public webServerIpv4CidrBlock: string; - - /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ - public cloudSqlIpv4CidrBlock: string; - - /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ - public webServerIpv4ReservedRange: string; - - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. */ - public cloudComposerNetworkIpv4CidrBlock: string; - - /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. */ - public cloudComposerNetworkIpv4ReservedRange: string; + /** RestartWebServerRequest name. */ + public name: string; /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * Creates a new RestartWebServerRequest instance using the specified properties. * @param [properties] Properties to set - * @returns PrivateEnvironmentConfig instance + * @returns RestartWebServerRequest instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @param message RestartWebServerRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. - * @param message PrivateEnvironmentConfig message or plain object to encode + * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @param message RestartWebServerRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * Decodes a RestartWebServerRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrivateEnvironmentConfig + * @returns RestartWebServerRequest * @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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrivateEnvironmentConfig + * @returns RestartWebServerRequest * @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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Verifies a PrivateEnvironmentConfig message. + * Verifies a RestartWebServerRequest 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 PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrivateEnvironmentConfig + * @returns RestartWebServerRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. - * @param message PrivateEnvironmentConfig + * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. + * @param message RestartWebServerRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrivateEnvironmentConfig to JSON. + * Converts this RestartWebServerRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PrivateEnvironmentConfig + * Gets the default type url for RestartWebServerRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DatabaseConfig. */ - interface IDatabaseConfig { + /** Properties of an ExecuteAirflowCommandResponse. */ + interface IExecuteAirflowCommandResponse { - /** DatabaseConfig machineType */ - machineType?: (string|null); + /** ExecuteAirflowCommandResponse executionId */ + executionId?: (string|null); + + /** ExecuteAirflowCommandResponse pod */ + pod?: (string|null); + + /** ExecuteAirflowCommandResponse podNamespace */ + podNamespace?: (string|null); + + /** ExecuteAirflowCommandResponse error */ + error?: (string|null); } - /** Represents a DatabaseConfig. */ - class DatabaseConfig implements IDatabaseConfig { + /** Represents an ExecuteAirflowCommandResponse. */ + class ExecuteAirflowCommandResponse implements IExecuteAirflowCommandResponse { /** - * Constructs a new DatabaseConfig. + * Constructs a new ExecuteAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse); - /** DatabaseConfig machineType. */ - public machineType: string; + /** ExecuteAirflowCommandResponse executionId. */ + public executionId: string; + + /** ExecuteAirflowCommandResponse pod. */ + public pod: string; + + /** ExecuteAirflowCommandResponse podNamespace. */ + public podNamespace: string; + + /** ExecuteAirflowCommandResponse error. */ + public error: string; /** - * Creates a new DatabaseConfig instance using the specified properties. + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns DatabaseConfig instance + * @returns ExecuteAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. - * @param message DatabaseConfig message or plain object to encode + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @param message ExecuteAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DatabaseConfig + * @returns ExecuteAirflowCommandResponse * @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.orchestration.airflow.service.v1beta1.DatabaseConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DatabaseConfig + * @returns ExecuteAirflowCommandResponse * @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.orchestration.airflow.service.v1beta1.DatabaseConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Verifies a DatabaseConfig message. + * Verifies an ExecuteAirflowCommandResponse 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 DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DatabaseConfig + * @returns ExecuteAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. - * @param message DatabaseConfig + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. + * @param message ExecuteAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DatabaseConfig to JSON. + * Converts this ExecuteAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for ExecuteAirflowCommandResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WebServerConfig. */ - interface IWebServerConfig { + /** Properties of a PollAirflowCommandResponse. */ + interface IPollAirflowCommandResponse { - /** WebServerConfig machineType */ - machineType?: (string|null); + /** PollAirflowCommandResponse output */ + output?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]|null); + + /** PollAirflowCommandResponse outputEnd */ + outputEnd?: (boolean|null); + + /** PollAirflowCommandResponse exitInfo */ + exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); } - /** Represents a WebServerConfig. */ - class WebServerConfig implements IWebServerConfig { + /** Represents a PollAirflowCommandResponse. */ + class PollAirflowCommandResponse implements IPollAirflowCommandResponse { /** - * Constructs a new WebServerConfig. + * Constructs a new PollAirflowCommandResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse); - /** WebServerConfig machineType. */ - public machineType: string; + /** PollAirflowCommandResponse output. */ + public output: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine[]; + + /** PollAirflowCommandResponse outputEnd. */ + public outputEnd: boolean; + + /** PollAirflowCommandResponse exitInfo. */ + public exitInfo?: (google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null); /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new PollAirflowCommandResponse instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerConfig instance + * @returns PollAirflowCommandResponse instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. - * @param message WebServerConfig message or plain object to encode + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @param message PollAirflowCommandResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerConfig + * @returns PollAirflowCommandResponse * @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.orchestration.airflow.service.v1beta1.WebServerConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerConfig + * @returns PollAirflowCommandResponse * @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.orchestration.airflow.service.v1beta1.WebServerConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Verifies a WebServerConfig message. + * Verifies a PollAirflowCommandResponse 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 WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerConfig + * @returns PollAirflowCommandResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. - * @param message WebServerConfig + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * @param message PollAirflowCommandResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerConfig to JSON. + * Converts this PollAirflowCommandResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for WebServerConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** + * Gets the default type url for PollAirflowCommandResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PollAirflowCommandResponse { + + /** Properties of a Line. */ + interface ILine { + + /** Line lineNumber */ + lineNumber?: (number|null); + + /** Line content */ + content?: (string|null); + } + + /** Represents a Line. */ + class Line implements ILine { + + /** + * Constructs a new Line. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine); + + /** Line lineNumber. */ + public lineNumber: number; + + /** Line content. */ + public content: string; + + /** + * Creates a new Line instance using the specified properties. + * @param [properties] Properties to set + * @returns Line instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @param message Line message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Line message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Line + * @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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; + + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Line + * @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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; + + /** + * Verifies a Line 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 Line message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Line + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @param message Line + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Line to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Line + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExitInfo. */ + interface IExitInfo { + + /** ExitInfo exitCode */ + exitCode?: (number|null); + + /** ExitInfo error */ + error?: (string|null); + } + + /** Represents an ExitInfo. */ + class ExitInfo implements IExitInfo { + + /** + * Constructs a new ExitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo); + + /** ExitInfo exitCode. */ + public exitCode: number; + + /** ExitInfo error. */ + public error: string; + + /** + * Creates a new ExitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ExitInfo instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @param message ExitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExitInfo + * @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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExitInfo + * @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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Verifies an ExitInfo 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 ExitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExitInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo; + + /** + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. + * @param message ExitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExitInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SaveSnapshotRequest. */ + interface ISaveSnapshotRequest { + + /** SaveSnapshotRequest environment */ + environment?: (string|null); + + /** SaveSnapshotRequest snapshotLocation */ + snapshotLocation?: (string|null); + } + + /** Represents a SaveSnapshotRequest. */ + class SaveSnapshotRequest implements ISaveSnapshotRequest { + + /** + * Constructs a new SaveSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest); + + /** SaveSnapshotRequest environment. */ + public environment: string; + + /** SaveSnapshotRequest snapshotLocation. */ + public snapshotLocation: string; + + /** + * Creates a new SaveSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SaveSnapshotRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + + /** + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @param message SaveSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaveSnapshotRequest + * @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.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + + /** + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaveSnapshotRequest + * @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.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + + /** + * Verifies a SaveSnapshotRequest 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 SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaveSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest; + + /** + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * @param message SaveSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SaveSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SaveSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SaveSnapshotResponse. */ + interface ISaveSnapshotResponse { + + /** SaveSnapshotResponse snapshotPath */ + snapshotPath?: (string|null); + } + + /** Represents a SaveSnapshotResponse. */ + class SaveSnapshotResponse implements ISaveSnapshotResponse { + + /** + * Constructs a new SaveSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse); + + /** SaveSnapshotResponse snapshotPath. */ + public snapshotPath: string; + + /** + * Creates a new SaveSnapshotResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SaveSnapshotResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + + /** + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @param message SaveSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaveSnapshotResponse + * @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.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + + /** + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaveSnapshotResponse + * @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.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + + /** + * Verifies a SaveSnapshotResponse 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 SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaveSnapshotResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse; + + /** + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * @param message SaveSnapshotResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SaveSnapshotResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SaveSnapshotResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoadSnapshotRequest. */ + interface ILoadSnapshotRequest { + + /** LoadSnapshotRequest environment */ + environment?: (string|null); + + /** LoadSnapshotRequest snapshotPath */ + snapshotPath?: (string|null); + + /** LoadSnapshotRequest skipPypiPackagesInstallation */ + skipPypiPackagesInstallation?: (boolean|null); + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting */ + skipEnvironmentVariablesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipAirflowOverridesSetting */ + skipAirflowOverridesSetting?: (boolean|null); + + /** LoadSnapshotRequest skipGcsDataCopying */ + skipGcsDataCopying?: (boolean|null); + } + + /** Represents a LoadSnapshotRequest. */ + class LoadSnapshotRequest implements ILoadSnapshotRequest { + + /** + * Constructs a new LoadSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest); + + /** LoadSnapshotRequest environment. */ + public environment: string; + + /** LoadSnapshotRequest snapshotPath. */ + public snapshotPath: string; + + /** LoadSnapshotRequest skipPypiPackagesInstallation. */ + public skipPypiPackagesInstallation: boolean; + + /** LoadSnapshotRequest skipEnvironmentVariablesSetting. */ + public skipEnvironmentVariablesSetting: boolean; + + /** LoadSnapshotRequest skipAirflowOverridesSetting. */ + public skipAirflowOverridesSetting: boolean; + + /** LoadSnapshotRequest skipGcsDataCopying. */ + public skipGcsDataCopying: boolean; + + /** + * Creates a new LoadSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadSnapshotRequest instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + + /** + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @param message LoadSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadSnapshotRequest + * @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.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadSnapshotRequest + * @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.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + + /** + * Verifies a LoadSnapshotRequest 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 LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest; + + /** + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @param message LoadSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LoadSnapshotResponse. */ + interface ILoadSnapshotResponse { + } + + /** Represents a LoadSnapshotResponse. */ + class LoadSnapshotResponse implements ILoadSnapshotResponse { + + /** + * Constructs a new LoadSnapshotResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse); + + /** + * Creates a new LoadSnapshotResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LoadSnapshotResponse instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + + /** + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @param message LoadSnapshotResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoadSnapshotResponse + * @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.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoadSnapshotResponse + * @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.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + + /** + * Verifies a LoadSnapshotResponse 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 LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoadSnapshotResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse; + + /** + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @param message LoadSnapshotResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoadSnapshotResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoadSnapshotResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnvironmentConfig. */ + interface IEnvironmentConfig { + + /** EnvironmentConfig gkeCluster */ + gkeCluster?: (string|null); + + /** EnvironmentConfig dagGcsPrefix */ + dagGcsPrefix?: (string|null); + + /** EnvironmentConfig nodeCount */ + nodeCount?: (number|null); + + /** EnvironmentConfig softwareConfig */ + softwareConfig?: (google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null); + + /** EnvironmentConfig nodeConfig */ + nodeConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null); + + /** EnvironmentConfig privateEnvironmentConfig */ + privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null); + + /** EnvironmentConfig webServerNetworkAccessControl */ + webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null); + + /** EnvironmentConfig databaseConfig */ + databaseConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null); + + /** EnvironmentConfig webServerConfig */ + webServerConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null); + + /** EnvironmentConfig airflowUri */ + airflowUri?: (string|null); + + /** EnvironmentConfig encryptionConfig */ + encryptionConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null); + + /** EnvironmentConfig maintenanceWindow */ + maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null); + + /** EnvironmentConfig workloadsConfig */ + workloadsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null); + + /** EnvironmentConfig environmentSize */ + environmentSize?: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|null); + + /** EnvironmentConfig masterAuthorizedNetworksConfig */ + masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig|null); + + /** EnvironmentConfig recoveryConfig */ + recoveryConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null); + } + + /** Represents an EnvironmentConfig. */ + class EnvironmentConfig implements IEnvironmentConfig { + + /** + * Constructs a new EnvironmentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig); + + /** EnvironmentConfig gkeCluster. */ + public gkeCluster: string; + + /** EnvironmentConfig dagGcsPrefix. */ + public dagGcsPrefix: string; + + /** EnvironmentConfig nodeCount. */ + public nodeCount: number; + + /** EnvironmentConfig softwareConfig. */ + public softwareConfig?: (google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null); + + /** EnvironmentConfig nodeConfig. */ + public nodeConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null); + + /** EnvironmentConfig privateEnvironmentConfig. */ + public privateEnvironmentConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null); + + /** EnvironmentConfig webServerNetworkAccessControl. */ + public webServerNetworkAccessControl?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null); + + /** EnvironmentConfig databaseConfig. */ + public databaseConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null); + + /** EnvironmentConfig webServerConfig. */ + public webServerConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null); + + /** EnvironmentConfig airflowUri. */ + public airflowUri: string; + + /** EnvironmentConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null); + + /** EnvironmentConfig maintenanceWindow. */ + public maintenanceWindow?: (google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null); + + /** EnvironmentConfig workloadsConfig. */ + public workloadsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null); + + /** EnvironmentConfig environmentSize. */ + public environmentSize: (google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize); + + /** EnvironmentConfig masterAuthorizedNetworksConfig. */ + public masterAuthorizedNetworksConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig|null); + + /** EnvironmentConfig recoveryConfig. */ + public recoveryConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null); + + /** + * Creates a new EnvironmentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvironmentConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + + /** + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvironmentConfig + * @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.orchestration.airflow.service.v1beta1.EnvironmentConfig; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvironmentConfig + * @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.orchestration.airflow.service.v1beta1.EnvironmentConfig; + + /** + * Verifies an EnvironmentConfig 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 EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvironmentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig; + + /** + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @param message EnvironmentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvironmentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvironmentConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnvironmentConfig { + + /** EnvironmentSize enum. */ + enum EnvironmentSize { + ENVIRONMENT_SIZE_UNSPECIFIED = 0, + ENVIRONMENT_SIZE_SMALL = 1, + ENVIRONMENT_SIZE_MEDIUM = 2, + ENVIRONMENT_SIZE_LARGE = 3 + } + } + + /** Properties of a WebServerNetworkAccessControl. */ + interface IWebServerNetworkAccessControl { + + /** WebServerNetworkAccessControl allowedIpRanges */ + allowedIpRanges?: (google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange[]|null); + } + + /** Represents a WebServerNetworkAccessControl. */ + class WebServerNetworkAccessControl implements IWebServerNetworkAccessControl { + + /** + * Constructs a new WebServerNetworkAccessControl. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl); + + /** WebServerNetworkAccessControl allowedIpRanges. */ + public allowedIpRanges: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange[]; + + /** + * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * @param [properties] Properties to set + * @returns WebServerNetworkAccessControl instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + + /** + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * @param message WebServerNetworkAccessControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebServerNetworkAccessControl + * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + + /** + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebServerNetworkAccessControl + * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + + /** + * Verifies a WebServerNetworkAccessControl 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 WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebServerNetworkAccessControl + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl; + + /** + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * @param message WebServerNetworkAccessControl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebServerNetworkAccessControl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebServerNetworkAccessControl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebServerNetworkAccessControl { + + /** Properties of an AllowedIpRange. */ + interface IAllowedIpRange { + + /** AllowedIpRange value */ + value?: (string|null); + + /** AllowedIpRange description */ + description?: (string|null); + } + + /** Represents an AllowedIpRange. */ + class AllowedIpRange implements IAllowedIpRange { + + /** + * Constructs a new AllowedIpRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange); + + /** AllowedIpRange value. */ + public value: string; + + /** AllowedIpRange description. */ + public description: string; + + /** + * Creates a new AllowedIpRange instance using the specified properties. + * @param [properties] Properties to set + * @returns AllowedIpRange instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @param message AllowedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllowedIpRange + * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllowedIpRange + * @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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Verifies an AllowedIpRange 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 AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllowedIpRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange; + + /** + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @param message AllowedIpRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllowedIpRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllowedIpRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SoftwareConfig. */ + interface ISoftwareConfig { + + /** SoftwareConfig imageVersion */ + imageVersion?: (string|null); + + /** SoftwareConfig airflowConfigOverrides */ + airflowConfigOverrides?: ({ [k: string]: string }|null); + + /** SoftwareConfig pypiPackages */ + pypiPackages?: ({ [k: string]: string }|null); + + /** SoftwareConfig envVariables */ + envVariables?: ({ [k: string]: string }|null); + + /** SoftwareConfig pythonVersion */ + pythonVersion?: (string|null); + + /** SoftwareConfig schedulerCount */ + schedulerCount?: (number|null); + + /** SoftwareConfig cloudDataLineageIntegration */ + cloudDataLineageIntegration?: (google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration|null); + } + + /** Represents a SoftwareConfig. */ + class SoftwareConfig implements ISoftwareConfig { + + /** + * Constructs a new SoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig); + + /** SoftwareConfig imageVersion. */ + public imageVersion: string; + + /** SoftwareConfig airflowConfigOverrides. */ + public airflowConfigOverrides: { [k: string]: string }; + + /** SoftwareConfig pypiPackages. */ + public pypiPackages: { [k: string]: string }; + + /** SoftwareConfig envVariables. */ + public envVariables: { [k: string]: string }; + + /** SoftwareConfig pythonVersion. */ + public pythonVersion: string; + + /** SoftwareConfig schedulerCount. */ + public schedulerCount: number; + + /** SoftwareConfig cloudDataLineageIntegration. */ + public cloudDataLineageIntegration?: (google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration|null); + + /** + * Creates a new SoftwareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwareConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig): google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig; + + /** + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwareConfig + * @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.orchestration.airflow.service.v1beta1.SoftwareConfig; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwareConfig + * @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.orchestration.airflow.service.v1beta1.SoftwareConfig; + + /** + * Verifies a SoftwareConfig 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 SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig; + + /** + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @param message SoftwareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a IPAllocationPolicy. */ + interface IIPAllocationPolicy { + + /** IPAllocationPolicy useIpAliases */ + useIpAliases?: (boolean|null); + + /** IPAllocationPolicy clusterSecondaryRangeName */ + clusterSecondaryRangeName?: (string|null); + + /** IPAllocationPolicy servicesSecondaryRangeName */ + servicesSecondaryRangeName?: (string|null); + + /** IPAllocationPolicy clusterIpv4CidrBlock */ + clusterIpv4CidrBlock?: (string|null); + + /** IPAllocationPolicy servicesIpv4CidrBlock */ + servicesIpv4CidrBlock?: (string|null); + } + + /** Represents a IPAllocationPolicy. */ + class IPAllocationPolicy implements IIPAllocationPolicy { + + /** + * Constructs a new IPAllocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy); + + /** IPAllocationPolicy useIpAliases. */ + public useIpAliases: boolean; + + /** IPAllocationPolicy clusterSecondaryRangeName. */ + public clusterSecondaryRangeName: string; + + /** IPAllocationPolicy servicesSecondaryRangeName. */ + public servicesSecondaryRangeName: string; + + /** IPAllocationPolicy clusterIpv4CidrBlock. */ + public clusterIpv4CidrBlock: string; + + /** IPAllocationPolicy servicesIpv4CidrBlock. */ + public servicesIpv4CidrBlock: string; + + /** + * Creates a new IPAllocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IPAllocationPolicy instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy): google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + + /** + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * @param message IPAllocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IPAllocationPolicy + * @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.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IPAllocationPolicy + * @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.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + + /** + * Verifies a IPAllocationPolicy 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 IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IPAllocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy; + + /** + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * @param message IPAllocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IPAllocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IPAllocationPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeConfig. */ + interface INodeConfig { + + /** NodeConfig location */ + location?: (string|null); + + /** NodeConfig machineType */ + machineType?: (string|null); + + /** NodeConfig network */ + network?: (string|null); + + /** NodeConfig subnetwork */ + subnetwork?: (string|null); + + /** NodeConfig diskSizeGb */ + diskSizeGb?: (number|null); + + /** NodeConfig oauthScopes */ + oauthScopes?: (string[]|null); + + /** NodeConfig serviceAccount */ + serviceAccount?: (string|null); + + /** NodeConfig tags */ + tags?: (string[]|null); + + /** NodeConfig ipAllocationPolicy */ + ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null); + + /** NodeConfig maxPodsPerNode */ + maxPodsPerNode?: (number|null); + + /** NodeConfig enableIpMasqAgent */ + enableIpMasqAgent?: (boolean|null); + } + + /** Represents a NodeConfig. */ + class NodeConfig implements INodeConfig { + + /** + * Constructs a new NodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig); + + /** NodeConfig location. */ + public location: string; + + /** NodeConfig machineType. */ + public machineType: string; + + /** NodeConfig network. */ + public network: string; + + /** NodeConfig subnetwork. */ + public subnetwork: string; + + /** NodeConfig diskSizeGb. */ + public diskSizeGb: number; + + /** NodeConfig oauthScopes. */ + public oauthScopes: string[]; + + /** NodeConfig serviceAccount. */ + public serviceAccount: string; + + /** NodeConfig tags. */ + public tags: string[]; + + /** NodeConfig ipAllocationPolicy. */ + public ipAllocationPolicy?: (google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null); + + /** NodeConfig maxPodsPerNode. */ + public maxPodsPerNode: number; + + /** NodeConfig enableIpMasqAgent. */ + public enableIpMasqAgent: boolean; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig): google.cloud.orchestration.airflow.service.v1beta1.NodeConfig; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * @param message NodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.INodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeConfig + * @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.orchestration.airflow.service.v1beta1.NodeConfig; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeConfig + * @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.orchestration.airflow.service.v1beta1.NodeConfig; + + /** + * Verifies a NodeConfig 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 NodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.NodeConfig; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @param message NodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.NodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivateClusterConfig. */ + interface IPrivateClusterConfig { + + /** PrivateClusterConfig enablePrivateEndpoint */ + enablePrivateEndpoint?: (boolean|null); + + /** PrivateClusterConfig masterIpv4CidrBlock */ + masterIpv4CidrBlock?: (string|null); + + /** PrivateClusterConfig masterIpv4ReservedRange */ + masterIpv4ReservedRange?: (string|null); + } + + /** Represents a PrivateClusterConfig. */ + class PrivateClusterConfig implements IPrivateClusterConfig { + + /** + * Constructs a new PrivateClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig); + + /** PrivateClusterConfig enablePrivateEndpoint. */ + public enablePrivateEndpoint: boolean; + + /** PrivateClusterConfig masterIpv4CidrBlock. */ + public masterIpv4CidrBlock: string; + + /** PrivateClusterConfig masterIpv4ReservedRange. */ + public masterIpv4ReservedRange: string; + + /** + * Creates a new PrivateClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateClusterConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig): google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + + /** + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateClusterConfig + * @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.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateClusterConfig + * @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.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + + /** + * Verifies a PrivateClusterConfig 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 PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig; + + /** + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @param message PrivateClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkingConfig. */ + interface INetworkingConfig { + + /** NetworkingConfig connectionType */ + connectionType?: (google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType|null); + } + + /** Represents a NetworkingConfig. */ + class NetworkingConfig implements INetworkingConfig { + + /** + * Constructs a new NetworkingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig); + + /** NetworkingConfig connectionType. */ + public connectionType: (google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType|keyof typeof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType); + + /** + * Creates a new NetworkingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkingConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig): google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig; + + /** + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.verify|verify} messages. + * @param message NetworkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkingConfig + * @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.orchestration.airflow.service.v1beta1.NetworkingConfig; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkingConfig + * @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.orchestration.airflow.service.v1beta1.NetworkingConfig; + + /** + * Verifies a NetworkingConfig 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 NetworkingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig; + + /** + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * @param message NetworkingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkingConfig { + + /** ConnectionType enum. */ + enum ConnectionType { + CONNECTION_TYPE_UNSPECIFIED = 0, + VPC_PEERING = 1, + PRIVATE_SERVICE_CONNECT = 2 + } + } + + /** Properties of a PrivateEnvironmentConfig. */ + interface IPrivateEnvironmentConfig { + + /** PrivateEnvironmentConfig enablePrivateEnvironment */ + enablePrivateEnvironment?: (boolean|null); + + /** PrivateEnvironmentConfig privateClusterConfig */ + privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null); + + /** PrivateEnvironmentConfig webServerIpv4CidrBlock */ + webServerIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock */ + cloudSqlIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig webServerIpv4ReservedRange */ + webServerIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock */ + cloudComposerNetworkIpv4CidrBlock?: (string|null); + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange */ + cloudComposerNetworkIpv4ReservedRange?: (string|null); + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps */ + enablePrivatelyUsedPublicIps?: (boolean|null); + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork */ + cloudComposerConnectionSubnetwork?: (string|null); + + /** PrivateEnvironmentConfig networkingConfig */ + networkingConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig|null); + } + + /** Represents a PrivateEnvironmentConfig. */ + class PrivateEnvironmentConfig implements IPrivateEnvironmentConfig { + + /** + * Constructs a new PrivateEnvironmentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig); + + /** PrivateEnvironmentConfig enablePrivateEnvironment. */ + public enablePrivateEnvironment: boolean; + + /** PrivateEnvironmentConfig privateClusterConfig. */ + public privateClusterConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null); + + /** PrivateEnvironmentConfig webServerIpv4CidrBlock. */ + public webServerIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. */ + public cloudSqlIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig webServerIpv4ReservedRange. */ + public webServerIpv4ReservedRange: string; + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. */ + public cloudComposerNetworkIpv4CidrBlock: string; + + /** PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. */ + public cloudComposerNetworkIpv4ReservedRange: string; + + /** PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. */ + public enablePrivatelyUsedPublicIps: boolean; + + /** PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. */ + public cloudComposerConnectionSubnetwork: string; + + /** PrivateEnvironmentConfig networkingConfig. */ + public networkingConfig?: (google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig|null); + + /** + * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateEnvironmentConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig): google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + + /** + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. + * @param message PrivateEnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateEnvironmentConfig + * @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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateEnvironmentConfig + * @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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + + /** + * Verifies a PrivateEnvironmentConfig 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 PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateEnvironmentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig; + + /** + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * @param message PrivateEnvironmentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateEnvironmentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateEnvironmentConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DatabaseConfig. */ + interface IDatabaseConfig { + + /** DatabaseConfig machineType */ + machineType?: (string|null); + } + + /** Represents a DatabaseConfig. */ + class DatabaseConfig implements IDatabaseConfig { + + /** + * Constructs a new DatabaseConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig); + + /** DatabaseConfig machineType. */ + public machineType: string; + + /** + * Creates a new DatabaseConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DatabaseConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig): google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig; + + /** + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * @param message DatabaseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatabaseConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatabaseConfig + * @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.orchestration.airflow.service.v1beta1.DatabaseConfig; + + /** + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatabaseConfig + * @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.orchestration.airflow.service.v1beta1.DatabaseConfig; + + /** + * Verifies a DatabaseConfig 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 DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatabaseConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig; + + /** + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * @param message DatabaseConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatabaseConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatabaseConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebServerConfig. */ + interface IWebServerConfig { + + /** WebServerConfig machineType */ + machineType?: (string|null); + } + + /** Represents a WebServerConfig. */ + class WebServerConfig implements IWebServerConfig { + + /** + * Constructs a new WebServerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig); + + /** WebServerConfig machineType. */ + public machineType: string; + + /** + * Creates a new WebServerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebServerConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig): google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig; + + /** + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * @param message WebServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebServerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebServerConfig + * @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.orchestration.airflow.service.v1beta1.WebServerConfig; + + /** + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebServerConfig + * @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.orchestration.airflow.service.v1beta1.WebServerConfig; + + /** + * Verifies a WebServerConfig 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 WebServerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebServerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig; + + /** + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * @param message WebServerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebServerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebServerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @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.orchestration.airflow.service.v1beta1.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @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.orchestration.airflow.service.v1beta1.EncryptionConfig; + + /** + * Verifies an EncryptionConfig 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceWindow. */ + interface IMaintenanceWindow { + + /** MaintenanceWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow recurrence */ + recurrence?: (string|null); + } + + /** Represents a MaintenanceWindow. */ + class MaintenanceWindow implements IMaintenanceWindow { + + /** + * Constructs a new MaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow); + + /** MaintenanceWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceWindow recurrence. */ + public recurrence: string; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceWindow instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow): google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * @param message MaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceWindow + * @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.orchestration.airflow.service.v1beta1.MaintenanceWindow; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceWindow + * @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.orchestration.airflow.service.v1beta1.MaintenanceWindow; + + /** + * Verifies a MaintenanceWindow 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 MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @param message MaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkloadsConfig. */ + interface IWorkloadsConfig { + + /** WorkloadsConfig scheduler */ + scheduler?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null); + + /** WorkloadsConfig webServer */ + webServer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker */ + worker?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null); + + /** WorkloadsConfig triggerer */ + triggerer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource|null); + } + + /** Represents a WorkloadsConfig. */ + class WorkloadsConfig implements IWorkloadsConfig { + + /** + * Constructs a new WorkloadsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig); + + /** WorkloadsConfig scheduler. */ + public scheduler?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null); + + /** WorkloadsConfig webServer. */ + public webServer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null); + + /** WorkloadsConfig worker. */ + public worker?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null); + + /** WorkloadsConfig triggerer. */ + public triggerer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource|null); + + /** + * Creates a new WorkloadsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkloadsConfig instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig; + + /** + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. + * @param message WorkloadsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkloadsConfig + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkloadsConfig + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig; + + /** + * Verifies a WorkloadsConfig 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 WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkloadsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig; + + /** + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * @param message WorkloadsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkloadsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkloadsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkloadsConfig { + + /** Properties of a SchedulerResource. */ + interface ISchedulerResource { + + /** SchedulerResource cpu */ + cpu?: (number|null); + + /** SchedulerResource memoryGb */ + memoryGb?: (number|null); + + /** SchedulerResource storageGb */ + storageGb?: (number|null); + + /** SchedulerResource count */ + count?: (number|null); + } + + /** Represents a SchedulerResource. */ + class SchedulerResource implements ISchedulerResource { + + /** + * Constructs a new SchedulerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource); + + /** SchedulerResource cpu. */ + public cpu: number; + + /** SchedulerResource memoryGb. */ + public memoryGb: number; + + /** SchedulerResource storageGb. */ + public storageGb: number; + + /** SchedulerResource count. */ + public count: number; + + /** + * Creates a new SchedulerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @param message SchedulerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + + /** + * Verifies a SchedulerResource 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 SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @param message SchedulerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WebServerResource. */ + interface IWebServerResource { + + /** WebServerResource cpu */ + cpu?: (number|null); + + /** WebServerResource memoryGb */ + memoryGb?: (number|null); + + /** WebServerResource storageGb */ + storageGb?: (number|null); + } + + /** Represents a WebServerResource. */ + class WebServerResource implements IWebServerResource { + + /** + * Constructs a new WebServerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource); + + /** WebServerResource cpu. */ + public cpu: number; + + /** WebServerResource memoryGb. */ + public memoryGb: number; + + /** WebServerResource storageGb. */ + public storageGb: number; + + /** + * Creates a new WebServerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WebServerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @param message WebServerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebServerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebServerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + + /** + * Verifies a WebServerResource 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 WebServerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebServerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @param message WebServerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebServerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebServerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerResource. */ + interface IWorkerResource { + + /** WorkerResource cpu */ + cpu?: (number|null); + + /** WorkerResource memoryGb */ + memoryGb?: (number|null); + + /** WorkerResource storageGb */ + storageGb?: (number|null); + + /** WorkerResource minCount */ + minCount?: (number|null); + + /** WorkerResource maxCount */ + maxCount?: (number|null); + } + + /** Represents a WorkerResource. */ + class WorkerResource implements IWorkerResource { + + /** + * Constructs a new WorkerResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource); + + /** WorkerResource cpu. */ + public cpu: number; + + /** WorkerResource memoryGb. */ + public memoryGb: number; + + /** WorkerResource storageGb. */ + public storageGb: number; + + /** WorkerResource minCount. */ + public minCount: number; + + /** WorkerResource maxCount. */ + public maxCount: number; + + /** + * Creates a new WorkerResource instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @param message WorkerResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + + /** + * Verifies a WorkerResource 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 WorkerResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @param message WorkerResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggererResource. */ + interface ITriggererResource { + + /** TriggererResource count */ + count?: (number|null); + + /** TriggererResource cpu */ + cpu?: (number|null); + + /** TriggererResource memoryGb */ + memoryGb?: (number|null); + } + + /** Represents a TriggererResource. */ + class TriggererResource implements ITriggererResource { + + /** + * Constructs a new TriggererResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource); + + /** TriggererResource count. */ + public count: number; + + /** TriggererResource cpu. */ + public cpu: number; + + /** TriggererResource memoryGb. */ + public memoryGb: number; + + /** + * Creates a new TriggererResource instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggererResource instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource; + + /** + * Encodes the specified TriggererResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.verify|verify} messages. + * @param message TriggererResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggererResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.verify|verify} messages. + * @param message TriggererResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggererResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggererResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource; + + /** + * Decodes a TriggererResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggererResource + * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource; + + /** + * Verifies a TriggererResource 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 TriggererResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggererResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource; + + /** + * Creates a plain object from a TriggererResource message. Also converts values to other types if specified. + * @param message TriggererResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggererResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggererResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { + /** Properties of a RecoveryConfig. */ + interface IRecoveryConfig { - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); + /** RecoveryConfig scheduledSnapshotsConfig */ + scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig|null); } - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { + /** Represents a RecoveryConfig. */ + class RecoveryConfig implements IRecoveryConfig { /** - * Constructs a new EncryptionConfig. + * Constructs a new RecoveryConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig); - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName: string; + /** RecoveryConfig scheduledSnapshotsConfig. */ + public scheduledSnapshotsConfig?: (google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig|null); /** - * Creates a new EncryptionConfig instance using the specified properties. + * Creates a new RecoveryConfig instance using the specified properties. * @param [properties] Properties to set - * @returns EncryptionConfig instance + * @returns RecoveryConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig): google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig): google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.verify|verify} messages. + * @param message RecoveryConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a RecoveryConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EncryptionConfig + * @returns RecoveryConfig * @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.orchestration.airflow.service.v1beta1.EncryptionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EncryptionConfig + * @returns RecoveryConfig * @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.orchestration.airflow.service.v1beta1.EncryptionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig; /** - * Verifies an EncryptionConfig message. + * Verifies a RecoveryConfig 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 EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EncryptionConfig + * @returns RecoveryConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. + * @param message RecoveryConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EncryptionConfig to JSON. + * Converts this RecoveryConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for RecoveryConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a MaintenanceWindow. */ - interface IMaintenanceWindow { + /** Properties of a ScheduledSnapshotsConfig. */ + interface IScheduledSnapshotsConfig { - /** MaintenanceWindow startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** ScheduledSnapshotsConfig enabled */ + enabled?: (boolean|null); - /** MaintenanceWindow endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** ScheduledSnapshotsConfig snapshotLocation */ + snapshotLocation?: (string|null); - /** MaintenanceWindow recurrence */ - recurrence?: (string|null); + /** ScheduledSnapshotsConfig snapshotCreationSchedule */ + snapshotCreationSchedule?: (string|null); + + /** ScheduledSnapshotsConfig timeZone */ + timeZone?: (string|null); } - /** Represents a MaintenanceWindow. */ - class MaintenanceWindow implements IMaintenanceWindow { + /** Represents a ScheduledSnapshotsConfig. */ + class ScheduledSnapshotsConfig implements IScheduledSnapshotsConfig { /** - * Constructs a new MaintenanceWindow. + * Constructs a new ScheduledSnapshotsConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig); - /** MaintenanceWindow startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** ScheduledSnapshotsConfig enabled. */ + public enabled: boolean; - /** MaintenanceWindow endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** ScheduledSnapshotsConfig snapshotLocation. */ + public snapshotLocation: string; - /** MaintenanceWindow recurrence. */ - public recurrence: string; + /** ScheduledSnapshotsConfig snapshotCreationSchedule. */ + public snapshotCreationSchedule: string; + + /** ScheduledSnapshotsConfig timeZone. */ + public timeZone: string; /** - * Creates a new MaintenanceWindow instance using the specified properties. + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. * @param [properties] Properties to set - * @returns MaintenanceWindow instance + * @returns ScheduledSnapshotsConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow): google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig): google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig; /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. - * @param message MaintenanceWindow message or plain object to encode + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.verify|verify} messages. + * @param message ScheduledSnapshotsConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MaintenanceWindow + * @returns ScheduledSnapshotsConfig * @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.orchestration.airflow.service.v1beta1.MaintenanceWindow; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MaintenanceWindow + * @returns ScheduledSnapshotsConfig * @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.orchestration.airflow.service.v1beta1.MaintenanceWindow; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig; /** - * Verifies a MaintenanceWindow message. + * Verifies a ScheduledSnapshotsConfig 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 MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MaintenanceWindow + * @returns ScheduledSnapshotsConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig; /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @param message MaintenanceWindow + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * @param message ScheduledSnapshotsConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MaintenanceWindow to JSON. + * Converts this ScheduledSnapshotsConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MaintenanceWindow + * Gets the default type url for ScheduledSnapshotsConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkloadsConfig. */ - interface IWorkloadsConfig { - - /** WorkloadsConfig scheduler */ - scheduler?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null); + /** Properties of a MasterAuthorizedNetworksConfig. */ + interface IMasterAuthorizedNetworksConfig { - /** WorkloadsConfig webServer */ - webServer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null); + /** MasterAuthorizedNetworksConfig enabled */ + enabled?: (boolean|null); - /** WorkloadsConfig worker */ - worker?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null); + /** MasterAuthorizedNetworksConfig cidrBlocks */ + cidrBlocks?: (google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock[]|null); } - /** Represents a WorkloadsConfig. */ - class WorkloadsConfig implements IWorkloadsConfig { + /** Represents a MasterAuthorizedNetworksConfig. */ + class MasterAuthorizedNetworksConfig implements IMasterAuthorizedNetworksConfig { /** - * Constructs a new WorkloadsConfig. + * Constructs a new MasterAuthorizedNetworksConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig); - - /** WorkloadsConfig scheduler. */ - public scheduler?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null); + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig); - /** WorkloadsConfig webServer. */ - public webServer?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null); + /** MasterAuthorizedNetworksConfig enabled. */ + public enabled: boolean; - /** WorkloadsConfig worker. */ - public worker?: (google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null); + /** MasterAuthorizedNetworksConfig cidrBlocks. */ + public cidrBlocks: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock[]; /** - * Creates a new WorkloadsConfig instance using the specified properties. + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. * @param [properties] Properties to set - * @returns WorkloadsConfig instance + * @returns MasterAuthorizedNetworksConfig instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig; /** - * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. - * @param message WorkloadsConfig message or plain object to encode + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. - * @param message WorkloadsConfig message or plain object to encode + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @param message MasterAuthorizedNetworksConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkloadsConfig message from the specified reader or buffer. + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkloadsConfig - * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig; - - /** - * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkloadsConfig + * @returns MasterAuthorizedNetworksConfig * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig; - - /** - * Verifies a WorkloadsConfig 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 WorkloadsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkloadsConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig; - - /** - * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. - * @param message WorkloadsConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkloadsConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkloadsConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WorkloadsConfig { - - /** Properties of a SchedulerResource. */ - interface ISchedulerResource { - - /** SchedulerResource cpu */ - cpu?: (number|null); - - /** SchedulerResource memoryGb */ - memoryGb?: (number|null); - - /** SchedulerResource storageGb */ - storageGb?: (number|null); - - /** SchedulerResource count */ - count?: (number|null); - } - - /** Represents a SchedulerResource. */ - class SchedulerResource implements ISchedulerResource { - - /** - * Constructs a new SchedulerResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource); - - /** SchedulerResource cpu. */ - public cpu: number; - - /** SchedulerResource memoryGb. */ - public memoryGb: number; - - /** SchedulerResource storageGb. */ - public storageGb: number; - - /** SchedulerResource count. */ - public count: number; - - /** - * Creates a new SchedulerResource instance using the specified properties. - * @param [properties] Properties to set - * @returns SchedulerResource instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; - - /** - * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @param message SchedulerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. - * @param message SchedulerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SchedulerResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SchedulerResource - * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; - - /** - * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SchedulerResource - * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig; - /** - * Verifies a SchedulerResource 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 MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MasterAuthorizedNetworksConfig + * @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.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig; - /** - * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SchedulerResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource; + /** + * Verifies a MasterAuthorizedNetworksConfig 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 SchedulerResource message. Also converts values to other types if specified. - * @param message SchedulerResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MasterAuthorizedNetworksConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig; - /** - * Converts this SchedulerResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. + * @param message MasterAuthorizedNetworksConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for SchedulerResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this MasterAuthorizedNetworksConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a WebServerResource. */ - interface IWebServerResource { + /** + * Gets the default type url for MasterAuthorizedNetworksConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** WebServerResource cpu */ - cpu?: (number|null); + namespace MasterAuthorizedNetworksConfig { - /** WebServerResource memoryGb */ - memoryGb?: (number|null); + /** Properties of a CidrBlock. */ + interface ICidrBlock { - /** WebServerResource storageGb */ - storageGb?: (number|null); + /** CidrBlock displayName */ + displayName?: (string|null); + + /** CidrBlock cidrBlock */ + cidrBlock?: (string|null); } - /** Represents a WebServerResource. */ - class WebServerResource implements IWebServerResource { + /** Represents a CidrBlock. */ + class CidrBlock implements ICidrBlock { /** - * Constructs a new WebServerResource. + * Constructs a new CidrBlock. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource); - - /** WebServerResource cpu. */ - public cpu: number; + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock); - /** WebServerResource memoryGb. */ - public memoryGb: number; + /** CidrBlock displayName. */ + public displayName: string; - /** WebServerResource storageGb. */ - public storageGb: number; + /** CidrBlock cidrBlock. */ + public cidrBlock: string; /** - * Creates a new WebServerResource instance using the specified properties. + * Creates a new CidrBlock instance using the specified properties. * @param [properties] Properties to set - * @returns WebServerResource instance + * @returns CidrBlock instance */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock; /** - * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @param message WebServerResource message or plain object to encode + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @param message WebServerResource message or plain object to encode + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @param message CidrBlock message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebServerResource message from the specified reader or buffer. + * Decodes a CidrBlock message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebServerResource + * @returns CidrBlock * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock; /** - * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebServerResource + * @returns CidrBlock * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock; /** - * Verifies a WebServerResource message. + * Verifies a CidrBlock 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 WebServerResource message from a plain object. Also converts values to their respective internal types. + * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebServerResource + * @returns CidrBlock */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource; + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock; /** - * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. - * @param message WebServerResource + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. + * @param message CidrBlock * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebServerResource to JSON. + * Converts this CidrBlock to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WebServerResource + * Gets the default type url for CidrBlock * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of a WorkerResource. */ - interface IWorkerResource { - - /** WorkerResource cpu */ - cpu?: (number|null); - - /** WorkerResource memoryGb */ - memoryGb?: (number|null); - - /** WorkerResource storageGb */ - storageGb?: (number|null); - - /** WorkerResource minCount */ - minCount?: (number|null); - - /** WorkerResource maxCount */ - maxCount?: (number|null); - } - - /** Represents a WorkerResource. */ - class WorkerResource implements IWorkerResource { - - /** - * Constructs a new WorkerResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource); - - /** WorkerResource cpu. */ - public cpu: number; + /** Properties of a CloudDataLineageIntegration. */ + interface ICloudDataLineageIntegration { - /** WorkerResource memoryGb. */ - public memoryGb: number; + /** CloudDataLineageIntegration enabled */ + enabled?: (boolean|null); + } - /** WorkerResource storageGb. */ - public storageGb: number; + /** Represents a CloudDataLineageIntegration. */ + class CloudDataLineageIntegration implements ICloudDataLineageIntegration { - /** WorkerResource minCount. */ - public minCount: number; + /** + * Constructs a new CloudDataLineageIntegration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration); - /** WorkerResource maxCount. */ - public maxCount: number; + /** CloudDataLineageIntegration enabled. */ + public enabled: boolean; - /** - * Creates a new WorkerResource instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkerResource instance - */ - public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + /** + * Creates a new CloudDataLineageIntegration instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudDataLineageIntegration instance + */ + public static create(properties?: google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration): google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration; - /** - * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @param message WorkerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CloudDataLineageIntegration message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.verify|verify} messages. + * @param message CloudDataLineageIntegration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. - * @param message WorkerResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CloudDataLineageIntegration message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.verify|verify} messages. + * @param message CloudDataLineageIntegration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a WorkerResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkerResource - * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + /** + * Decodes a CloudDataLineageIntegration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudDataLineageIntegration + * @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.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration; - /** - * Decodes a WorkerResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkerResource - * @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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + /** + * Decodes a CloudDataLineageIntegration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudDataLineageIntegration + * @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.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration; - /** - * Verifies a WorkerResource 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); + /** + * Verifies a CloudDataLineageIntegration 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 WorkerResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkerResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource; + /** + * Creates a CloudDataLineageIntegration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudDataLineageIntegration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration; - /** - * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. - * @param message WorkerResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a CloudDataLineageIntegration message. Also converts values to other types if specified. + * @param message CloudDataLineageIntegration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this WorkerResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this CloudDataLineageIntegration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for WorkerResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for CloudDataLineageIntegration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Environment. */ @@ -6554,7 +9874,9 @@ export namespace google { CREATE = 1, DELETE = 2, UPDATE = 3, - CHECK = 4 + CHECK = 4, + SAVE_SNAPSHOT = 5, + LOAD_SNAPSHOT = 6 } } } diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.js b/packages/google-cloud-orchestration-airflow-service/protos/protos.js index b53b67125be..00b2f1b0122 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.js +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.js @@ -281,6 +281,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|saveSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef SaveSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.saveSnapshot = function saveSnapshot(request, callback) { + return this.rpcCall(saveSnapshot, $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SaveSnapshot" }); + + /** + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.Environments|loadSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @typedef LoadSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.loadSnapshot = function loadSnapshot(request, callback) { + return this.rpcCall(loadSnapshot, $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LoadSnapshot" }); + + /** + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Environments; })(); @@ -1680,34 +1746,25 @@ return UpdateEnvironmentRequest; })(); - v1.EnvironmentConfig = (function() { + v1.SaveSnapshotRequest = (function() { /** - * Properties of an EnvironmentConfig. + * Properties of a SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEnvironmentConfig - * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster - * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix - * @property {number|null} [nodeCount] EnvironmentConfig nodeCount - * @property {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig - * @property {google.cloud.orchestration.airflow.service.v1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig - * @property {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig - * @property {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl - * @property {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig - * @property {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig - * @property {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig - * @property {string|null} [airflowUri] EnvironmentConfig airflowUri + * @interface ISaveSnapshotRequest + * @property {string|null} [environment] SaveSnapshotRequest environment + * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation */ /** - * Constructs a new EnvironmentConfig. + * Constructs a new SaveSnapshotRequest. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an EnvironmentConfig. - * @implements IEnvironmentConfig + * @classdesc Represents a SaveSnapshotRequest. + * @implements ISaveSnapshotRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set */ - function EnvironmentConfig(properties) { + function SaveSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1715,215 +1772,89 @@ } /** - * EnvironmentConfig gkeCluster. - * @member {string} gkeCluster - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.gkeCluster = ""; - - /** - * EnvironmentConfig dagGcsPrefix. - * @member {string} dagGcsPrefix - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.dagGcsPrefix = ""; - - /** - * EnvironmentConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.nodeCount = 0; - - /** - * EnvironmentConfig softwareConfig. - * @member {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null|undefined} softwareConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.softwareConfig = null; - - /** - * EnvironmentConfig nodeConfig. - * @member {google.cloud.orchestration.airflow.service.v1.INodeConfig|null|undefined} nodeConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.nodeConfig = null; - - /** - * EnvironmentConfig privateEnvironmentConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.privateEnvironmentConfig = null; - - /** - * EnvironmentConfig webServerNetworkAccessControl. - * @member {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.webServerNetworkAccessControl = null; - - /** - * EnvironmentConfig databaseConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null|undefined} databaseConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.databaseConfig = null; - - /** - * EnvironmentConfig webServerConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null|undefined} webServerConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.webServerConfig = null; - - /** - * EnvironmentConfig encryptionConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * SaveSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @instance */ - EnvironmentConfig.prototype.encryptionConfig = null; + SaveSnapshotRequest.prototype.environment = ""; /** - * EnvironmentConfig airflowUri. - * @member {string} airflowUri - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * SaveSnapshotRequest snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @instance */ - EnvironmentConfig.prototype.airflowUri = ""; + SaveSnapshotRequest.prototype.snapshotLocation = ""; /** - * Creates a new EnvironmentConfig instance using the specified properties. + * Creates a new SaveSnapshotRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest instance */ - EnvironmentConfig.create = function create(properties) { - return new EnvironmentConfig(properties); + SaveSnapshotRequest.create = function create(properties) { + return new SaveSnapshotRequest(properties); }; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encode = function encode(message, writer) { + SaveSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); - if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); - if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) - $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) - $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); - if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) - $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) - $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) - $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) - $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); return writer; }; /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decode = function decode(reader, length) { + SaveSnapshotRequest.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.orchestration.airflow.service.v1.EnvironmentConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.gkeCluster = reader.string(); + message.environment = reader.string(); break; } case 2: { - message.dagGcsPrefix = reader.string(); - break; - } - case 3: { - message.nodeCount = reader.int32(); - break; - } - case 4: { - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); - break; - } - case 9: { - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.airflowUri = reader.string(); + message.snapshotLocation = reader.string(); break; } default: @@ -1935,239 +1866,131 @@ }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnvironmentConfig message. + * Verifies a SaveSnapshotRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnvironmentConfig.verify = function verify(message) { + SaveSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - if (!$util.isString(message.gkeCluster)) - return "gkeCluster: string expected"; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - if (!$util.isString(message.dagGcsPrefix)) - return "dagGcsPrefix: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify(message.softwareConfig); - if (error) - return "softwareConfig." + error; - } - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.verify(message.nodeConfig); - if (error) - return "nodeConfig." + error; - } - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); - if (error) - return "privateEnvironmentConfig." + error; - } - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); - if (error) - return "webServerNetworkAccessControl." + error; - } - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify(message.databaseConfig); - if (error) - return "databaseConfig." + error; - } - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify(message.webServerConfig); - if (error) - return "webServerConfig." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - if (!$util.isString(message.airflowUri)) - return "airflowUri: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; return null; }; /** - * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} SaveSnapshotRequest */ - EnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig) + SaveSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); - if (object.gkeCluster != null) - message.gkeCluster = String(object.gkeCluster); - if (object.dagGcsPrefix != null) - message.dagGcsPrefix = String(object.dagGcsPrefix); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.softwareConfig != null) { - if (typeof object.softwareConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.softwareConfig: object expected"); - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.fromObject(object.softwareConfig); - } - if (object.nodeConfig != null) { - if (typeof object.nodeConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.nodeConfig: object expected"); - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.fromObject(object.nodeConfig); - } - if (object.privateEnvironmentConfig != null) { - if (typeof object.privateEnvironmentConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.privateEnvironmentConfig: object expected"); - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); - } - if (object.webServerNetworkAccessControl != null) { - if (typeof object.webServerNetworkAccessControl !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); - } - if (object.databaseConfig != null) { - if (typeof object.databaseConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.databaseConfig: object expected"); - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.fromObject(object.databaseConfig); - } - if (object.webServerConfig != null) { - if (typeof object.webServerConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerConfig: object expected"); - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.fromObject(object.webServerConfig); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.airflowUri != null) - message.airflowUri = String(object.airflowUri); + var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); return message; }; /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} message EnvironmentConfig + * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest} message SaveSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnvironmentConfig.toObject = function toObject(message, options) { + SaveSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.gkeCluster = ""; - object.dagGcsPrefix = ""; - object.nodeCount = 0; - object.softwareConfig = null; - object.nodeConfig = null; - object.airflowUri = ""; - object.privateEnvironmentConfig = null; - object.webServerNetworkAccessControl = null; - object.databaseConfig = null; - object.webServerConfig = null; - object.encryptionConfig = null; + object.environment = ""; + object.snapshotLocation = ""; } - if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - object.gkeCluster = message.gkeCluster; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - object.dagGcsPrefix = message.dagGcsPrefix; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) - object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.toObject(message.softwareConfig, options); - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) - object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.toObject(message.nodeConfig, options); - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - object.airflowUri = message.airflowUri; - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) - object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) - object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) - object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.toObject(message.databaseConfig, options); - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) - object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.toObject(message.webServerConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; return object; }; /** - * Converts this EnvironmentConfig to JSON. + * Converts this SaveSnapshotRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @instance * @returns {Object.} JSON object */ - EnvironmentConfig.prototype.toJSON = function toJSON() { + SaveSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnvironmentConfig + * Gets the default type url for SaveSnapshotRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EnvironmentConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest"; }; - return EnvironmentConfig; + return SaveSnapshotRequest; })(); - v1.WebServerNetworkAccessControl = (function() { + v1.SaveSnapshotResponse = (function() { /** - * Properties of a WebServerNetworkAccessControl. + * Properties of a SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IWebServerNetworkAccessControl - * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges + * @interface ISaveSnapshotResponse + * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath */ /** - * Constructs a new WebServerNetworkAccessControl. + * Constructs a new SaveSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a WebServerNetworkAccessControl. - * @implements IWebServerNetworkAccessControl + * @classdesc Represents a SaveSnapshotResponse. + * @implements ISaveSnapshotResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set */ - function WebServerNetworkAccessControl(properties) { - this.allowedIpRanges = []; + function SaveSnapshotResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2175,78 +1998,75 @@ } /** - * WebServerNetworkAccessControl allowedIpRanges. - * @member {Array.} allowedIpRanges - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * SaveSnapshotResponse snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @instance */ - WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; + SaveSnapshotResponse.prototype.snapshotPath = ""; /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * Creates a new SaveSnapshotResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse instance */ - WebServerNetworkAccessControl.create = function create(properties) { - return new WebServerNetworkAccessControl(properties); + SaveSnapshotResponse.create = function create(properties) { + return new SaveSnapshotResponse(properties); }; /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerNetworkAccessControl.encode = function encode(message, writer) { + SaveSnapshotResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedIpRanges != null && message.allowedIpRanges.length) - for (var i = 0; i < message.allowedIpRanges.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); return writer; }; /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerNetworkAccessControl.decode = function decode(reader, length) { + SaveSnapshotResponse.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.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.allowedIpRanges && message.allowedIpRanges.length)) - message.allowedIpRanges = []; - message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); + message.snapshotPath = reader.string(); break; } default: @@ -2258,569 +2078,440 @@ }; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { + SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebServerNetworkAccessControl message. + * Verifies a SaveSnapshotResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebServerNetworkAccessControl.verify = function verify(message) { + SaveSnapshotResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { - if (!Array.isArray(message.allowedIpRanges)) - return "allowedIpRanges: array expected"; - for (var i = 0; i < message.allowedIpRanges.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); - if (error) - return "allowedIpRanges." + error; - } - } + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; return null; }; /** - * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} SaveSnapshotResponse */ - WebServerNetworkAccessControl.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl) + SaveSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); - if (object.allowedIpRanges) { - if (!Array.isArray(object.allowedIpRanges)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); - message.allowedIpRanges = []; - for (var i = 0; i < object.allowedIpRanges.length; ++i) { - if (typeof object.allowedIpRanges[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); - message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); - } - } + var message = new $root.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse(); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); return message; }; /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl + * @param {google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse} message SaveSnapshotResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebServerNetworkAccessControl.toObject = function toObject(message, options) { + SaveSnapshotResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedIpRanges = []; - if (message.allowedIpRanges && message.allowedIpRanges.length) { - object.allowedIpRanges = []; - for (var j = 0; j < message.allowedIpRanges.length; ++j) - object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); - } + if (options.defaults) + object.snapshotPath = ""; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; return object; }; /** - * Converts this WebServerNetworkAccessControl to JSON. + * Converts this SaveSnapshotResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @instance * @returns {Object.} JSON object */ - WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { + SaveSnapshotResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WebServerNetworkAccessControl + * Gets the default type url for SaveSnapshotResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse"; }; - WebServerNetworkAccessControl.AllowedIpRange = (function() { + return SaveSnapshotResponse; + })(); - /** - * Properties of an AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @interface IAllowedIpRange - * @property {string|null} [value] AllowedIpRange value - * @property {string|null} [description] AllowedIpRange description - */ + v1.LoadSnapshotRequest = (function() { - /** - * Constructs a new AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl - * @classdesc Represents an AllowedIpRange. - * @implements IAllowedIpRange - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set - */ - function AllowedIpRange(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 LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface ILoadSnapshotRequest + * @property {string|null} [environment] LoadSnapshotRequest environment + * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath + * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation + * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting + * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting + * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying + */ - /** - * AllowedIpRange value. - * @member {string} value - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - */ - AllowedIpRange.prototype.value = ""; + /** + * Constructs a new LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a LoadSnapshotRequest. + * @implements ILoadSnapshotRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set + */ + function LoadSnapshotRequest(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]]; + } - /** - * AllowedIpRange description. - * @member {string} description - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - */ - AllowedIpRange.prototype.description = ""; - - /** - * Creates a new AllowedIpRange instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance - */ - AllowedIpRange.create = function create(properties) { - return new AllowedIpRange(properties); - }; - - /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedIpRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; - - /** - * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedIpRange.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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedIpRange message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedIpRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - */ - AllowedIpRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); - if (object.value != null) - message.value = String(object.value); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedIpRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.description = ""; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this AllowedIpRange to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - * @returns {Object.} JSON object - */ - AllowedIpRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedIpRange - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange"; - }; - - return AllowedIpRange; - })(); + /** + * LoadSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.environment = ""; - return WebServerNetworkAccessControl; - })(); + /** + * LoadSnapshotRequest snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.snapshotPath = ""; - v1.DatabaseConfig = (function() { + /** + * LoadSnapshotRequest skipPypiPackagesInstallation. + * @member {boolean} skipPypiPackagesInstallation + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; /** - * Properties of a DatabaseConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IDatabaseConfig - * @property {string|null} [machineType] DatabaseConfig machineType + * LoadSnapshotRequest skipEnvironmentVariablesSetting. + * @member {boolean} skipEnvironmentVariablesSetting + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance */ + LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; /** - * Constructs a new DatabaseConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a DatabaseConfig. - * @implements IDatabaseConfig - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set + * LoadSnapshotRequest skipAirflowOverridesSetting. + * @member {boolean} skipAirflowOverridesSetting + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest + * @instance */ - function DatabaseConfig(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]]; - } + LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; /** - * DatabaseConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * LoadSnapshotRequest skipGcsDataCopying. + * @member {boolean} skipGcsDataCopying + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @instance */ - DatabaseConfig.prototype.machineType = ""; + LoadSnapshotRequest.prototype.skipGcsDataCopying = false; /** - * Creates a new DatabaseConfig instance using the specified properties. + * Creates a new LoadSnapshotRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest instance */ - DatabaseConfig.create = function create(properties) { - return new DatabaseConfig(properties); + LoadSnapshotRequest.create = function create(properties) { + return new LoadSnapshotRequest(properties); }; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encode = function encode(message, writer) { + LoadSnapshotRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); + if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); + if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); + if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); + if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); return writer; }; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { + LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decode = function decode(reader, length) { + LoadSnapshotRequest.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.orchestration.airflow.service.v1.DatabaseConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); + message.environment = reader.string(); break; } - default: - reader.skipType(tag & 7); - break; + case 2: { + message.snapshotPath = reader.string(); + break; + } + case 3: { + message.skipPypiPackagesInstallation = reader.bool(); + break; + } + case 4: { + message.skipEnvironmentVariablesSetting = reader.bool(); + break; + } + case 5: { + message.skipAirflowOverridesSetting = reader.bool(); + break; + } + case 6: { + message.skipGcsDataCopying = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } } return message; }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { + LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DatabaseConfig message. + * Verifies a LoadSnapshotRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DatabaseConfig.verify = function verify(message) { + LoadSnapshotRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + if (typeof message.skipPypiPackagesInstallation !== "boolean") + return "skipPypiPackagesInstallation: boolean expected"; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + if (typeof message.skipEnvironmentVariablesSetting !== "boolean") + return "skipEnvironmentVariablesSetting: boolean expected"; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + if (typeof message.skipAirflowOverridesSetting !== "boolean") + return "skipAirflowOverridesSetting: boolean expected"; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + if (typeof message.skipGcsDataCopying !== "boolean") + return "skipGcsDataCopying: boolean expected"; return null; }; /** - * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} LoadSnapshotRequest */ - DatabaseConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig) + LoadSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); + var message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); + if (object.skipPypiPackagesInstallation != null) + message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); + if (object.skipEnvironmentVariablesSetting != null) + message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); + if (object.skipAirflowOverridesSetting != null) + message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); + if (object.skipGcsDataCopying != null) + message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); return message; }; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} message DatabaseConfig + * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest} message LoadSnapshotRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseConfig.toObject = function toObject(message, options) { + LoadSnapshotRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; + if (options.defaults) { + object.environment = ""; + object.snapshotPath = ""; + object.skipPypiPackagesInstallation = false; + object.skipEnvironmentVariablesSetting = false; + object.skipAirflowOverridesSetting = false; + object.skipGcsDataCopying = false; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + object.skipGcsDataCopying = message.skipGcsDataCopying; return object; }; /** - * Converts this DatabaseConfig to JSON. + * Converts this LoadSnapshotRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @instance * @returns {Object.} JSON object */ - DatabaseConfig.prototype.toJSON = function toJSON() { + LoadSnapshotRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for LoadSnapshotRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest"; }; - return DatabaseConfig; + return LoadSnapshotRequest; })(); - v1.WebServerConfig = (function() { + v1.LoadSnapshotResponse = (function() { /** - * Properties of a WebServerConfig. + * Properties of a LoadSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IWebServerConfig - * @property {string|null} [machineType] WebServerConfig machineType + * @interface ILoadSnapshotResponse */ /** - * Constructs a new WebServerConfig. + * Constructs a new LoadSnapshotResponse. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a WebServerConfig. - * @implements IWebServerConfig + * @classdesc Represents a LoadSnapshotResponse. + * @implements ILoadSnapshotResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set */ - function WebServerConfig(properties) { + function LoadSnapshotResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2828,77 +2519,63 @@ } /** - * WebServerConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig - * @instance - */ - WebServerConfig.prototype.machineType = ""; - - /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new LoadSnapshotResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse instance */ - WebServerConfig.create = function create(properties) { - return new WebServerConfig(properties); + LoadSnapshotResponse.create = function create(properties) { + return new LoadSnapshotResponse(properties); }; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encode = function encode(message, writer) { + LoadSnapshotResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); return writer; }; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decode = function decode(reader, length) { + LoadSnapshotResponse.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.orchestration.airflow.service.v1.WebServerConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -2908,122 +2585,124 @@ }; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decodeDelimited = function decodeDelimited(reader) { + LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebServerConfig message. + * Verifies a LoadSnapshotResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebServerConfig.verify = function verify(message) { + LoadSnapshotResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; return null; }; /** - * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} LoadSnapshotResponse */ - WebServerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig) + LoadSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); - return message; + return new $root.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse(); }; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1.WebServerConfig} message WebServerConfig + * @param {google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse} message LoadSnapshotResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebServerConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - return object; + LoadSnapshotResponse.toObject = function toObject() { + return {}; }; /** - * Converts this WebServerConfig to JSON. + * Converts this LoadSnapshotResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @instance * @returns {Object.} JSON object */ - WebServerConfig.prototype.toJSON = function toJSON() { + LoadSnapshotResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WebServerConfig + * Gets the default type url for LoadSnapshotResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse"; }; - return WebServerConfig; + return LoadSnapshotResponse; })(); - v1.EncryptionConfig = (function() { + v1.EnvironmentConfig = (function() { /** - * Properties of an EncryptionConfig. + * Properties of an EnvironmentConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @interface IEnvironmentConfig + * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster + * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix + * @property {number|null} [nodeCount] EnvironmentConfig nodeCount + * @property {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig + * @property {google.cloud.orchestration.airflow.service.v1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig + * @property {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig + * @property {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl + * @property {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig + * @property {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig + * @property {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig + * @property {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null} [maintenanceWindow] EnvironmentConfig maintenanceWindow + * @property {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null} [workloadsConfig] EnvironmentConfig workloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize + * @property {string|null} [airflowUri] EnvironmentConfig airflowUri + * @property {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null} [masterAuthorizedNetworksConfig] EnvironmentConfig masterAuthorizedNetworksConfig + * @property {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null} [recoveryConfig] EnvironmentConfig recoveryConfig */ /** - * Constructs a new EncryptionConfig. + * Constructs a new EnvironmentConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * @classdesc Represents an EnvironmentConfig. + * @implements IEnvironmentConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function EnvironmentConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3031,401 +2710,285 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * EnvironmentConfig gkeCluster. + * @member {string} gkeCluster + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + EnvironmentConfig.prototype.gkeCluster = ""; /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig instance + * EnvironmentConfig dagGcsPrefix. + * @member {string} dagGcsPrefix + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; + EnvironmentConfig.prototype.dagGcsPrefix = ""; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * EnvironmentConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - return writer; - }; + EnvironmentConfig.prototype.nodeCount = 0; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * EnvironmentConfig softwareConfig. + * @member {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + EnvironmentConfig.prototype.softwareConfig = null; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * EnvironmentConfig nodeConfig. + * @member {google.cloud.orchestration.airflow.service.v1.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.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.orchestration.airflow.service.v1.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kmsKeyName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - return null; - }; + EnvironmentConfig.prototype.nodeConfig = null; /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig + * EnvironmentConfig privateEnvironmentConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - return message; - }; + EnvironmentConfig.prototype.privateEnvironmentConfig = null; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * EnvironmentConfig webServerNetworkAccessControl. + * @member {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - return object; - }; + EnvironmentConfig.prototype.webServerNetworkAccessControl = null; /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig + * EnvironmentConfig databaseConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig|null|undefined} databaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance - * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + EnvironmentConfig.prototype.databaseConfig = null; /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * EnvironmentConfig webServerConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IWebServerConfig|null|undefined} webServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1.SoftwareConfig = (function() { + EnvironmentConfig.prototype.webServerConfig = null; /** - * Properties of a SoftwareConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ISoftwareConfig - * @property {string|null} [imageVersion] SoftwareConfig imageVersion - * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides - * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages - * @property {Object.|null} [envVariables] SoftwareConfig envVariables - * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion + * EnvironmentConfig encryptionConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ + EnvironmentConfig.prototype.encryptionConfig = null; /** - * Constructs a new SoftwareConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a SoftwareConfig. - * @implements ISoftwareConfig - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set + * EnvironmentConfig maintenanceWindow. + * @member {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow|null|undefined} maintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig + * @instance */ - function SoftwareConfig(properties) { - this.airflowConfigOverrides = {}; - this.pypiPackages = {}; - this.envVariables = {}; - 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]]; - } + EnvironmentConfig.prototype.maintenanceWindow = null; /** - * SoftwareConfig imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * EnvironmentConfig workloadsConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig|null|undefined} workloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - SoftwareConfig.prototype.imageVersion = ""; + EnvironmentConfig.prototype.workloadsConfig = null; /** - * SoftwareConfig airflowConfigOverrides. - * @member {Object.} airflowConfigOverrides - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * EnvironmentConfig environmentSize. + * @member {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize} environmentSize + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; + EnvironmentConfig.prototype.environmentSize = 0; /** - * SoftwareConfig pypiPackages. - * @member {Object.} pypiPackages - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * EnvironmentConfig airflowUri. + * @member {string} airflowUri + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - SoftwareConfig.prototype.pypiPackages = $util.emptyObject; + EnvironmentConfig.prototype.airflowUri = ""; /** - * SoftwareConfig envVariables. - * @member {Object.} envVariables - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * EnvironmentConfig masterAuthorizedNetworksConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig|null|undefined} masterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - SoftwareConfig.prototype.envVariables = $util.emptyObject; + EnvironmentConfig.prototype.masterAuthorizedNetworksConfig = null; /** - * SoftwareConfig pythonVersion. - * @member {string} pythonVersion - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * EnvironmentConfig recoveryConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig|null|undefined} recoveryConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance */ - SoftwareConfig.prototype.pythonVersion = ""; + EnvironmentConfig.prototype.recoveryConfig = null; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new EnvironmentConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig instance */ - SoftwareConfig.create = function create(properties) { - return new SoftwareConfig(properties); + EnvironmentConfig.create = function create(properties) { + return new EnvironmentConfig(properties); }; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encode = function encode(message, writer) { + EnvironmentConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); - if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) - for (var keys = Object.keys(message.airflowConfigOverrides), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.airflowConfigOverrides[keys[i]]).ldelim(); - if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) - for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); - if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) - for (var keys = Object.keys(message.envVariables), 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.envVariables[keys[i]]).ldelim(); - if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); + if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); + if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); + if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) + $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) + $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) + $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) + $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.workloadsConfig != null && Object.hasOwnProperty.call(message, "workloadsConfig")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.encode(message.workloadsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.environmentSize != null && Object.hasOwnProperty.call(message, "environmentSize")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.environmentSize); + if (message.masterAuthorizedNetworksConfig != null && Object.hasOwnProperty.call(message, "masterAuthorizedNetworksConfig")) + $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.encode(message.masterAuthorizedNetworksConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.recoveryConfig != null && Object.hasOwnProperty.call(message, "recoveryConfig")) + $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.encode(message.recoveryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); return writer; }; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes an EnvironmentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decode = function decode(reader, length) { + EnvironmentConfig.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.orchestration.airflow.service.v1.SoftwareConfig(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.imageVersion = reader.string(); + message.gkeCluster = reader.string(); break; } case 2: { - if (message.airflowConfigOverrides === $util.emptyObject) - message.airflowConfigOverrides = {}; - 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.airflowConfigOverrides[key] = value; + message.dagGcsPrefix = reader.string(); break; } case 3: { - if (message.pypiPackages === $util.emptyObject) - message.pypiPackages = {}; - 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.pypiPackages[key] = value; + message.nodeCount = reader.int32(); break; } case 4: { - if (message.envVariables === $util.emptyObject) - message.envVariables = {}; - 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.envVariables[key] = value; + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); + break; + } + case 9: { + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.decode(reader, reader.uint32()); + break; + } + case 15: { + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.environmentSize = reader.int32(); break; } case 6: { - message.pythonVersion = reader.string(); + message.airflowUri = reader.string(); + break; + } + case 17: { + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.decode(reader, reader.uint32()); break; } default: @@ -3437,201 +3000,346 @@ }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SoftwareConfig message. + * Verifies an EnvironmentConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SoftwareConfig.verify = function verify(message) { + EnvironmentConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - if (!$util.isString(message.imageVersion)) - return "imageVersion: string expected"; - if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { - if (!$util.isObject(message.airflowConfigOverrides)) - return "airflowConfigOverrides: object expected"; - var key = Object.keys(message.airflowConfigOverrides); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.airflowConfigOverrides[key[i]])) - return "airflowConfigOverrides: string{k:string} expected"; + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + if (!$util.isString(message.gkeCluster)) + return "gkeCluster: string expected"; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + if (!$util.isString(message.dagGcsPrefix)) + return "dagGcsPrefix: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; } - if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { - if (!$util.isObject(message.pypiPackages)) - return "pypiPackages: object expected"; - var key = Object.keys(message.pypiPackages); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.pypiPackages[key[i]])) - return "pypiPackages: string{k:string} expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; } - if (message.envVariables != null && message.hasOwnProperty("envVariables")) { - if (!$util.isObject(message.envVariables)) - return "envVariables: object expected"; - var key = Object.keys(message.envVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.envVariables[key[i]])) - return "envVariables: string{k:string} expected"; + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); + if (error) + return "privateEnvironmentConfig." + error; + } + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); + if (error) + return "webServerNetworkAccessControl." + error; + } + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify(message.databaseConfig); + if (error) + return "databaseConfig." + error; + } + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify(message.webServerConfig); + if (error) + return "webServerConfig." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify(message.maintenanceWindow); + if (error) + return "maintenanceWindow." + error; + } + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify(message.workloadsConfig); + if (error) + return "workloadsConfig." + error; + } + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + switch (message.environmentSize) { + default: + return "environmentSize: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + if (!$util.isString(message.airflowUri)) + return "airflowUri: string expected"; + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify(message.masterAuthorizedNetworksConfig); + if (error) + return "masterAuthorizedNetworksConfig." + error; + } + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify(message.recoveryConfig); + if (error) + return "recoveryConfig." + error; } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - if (!$util.isString(message.pythonVersion)) - return "pythonVersion: string expected"; return null; }; /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} EnvironmentConfig */ - SoftwareConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig) + EnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(); - if (object.imageVersion != null) - message.imageVersion = String(object.imageVersion); - if (object.airflowConfigOverrides) { - if (typeof object.airflowConfigOverrides !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.airflowConfigOverrides: object expected"); - message.airflowConfigOverrides = {}; - for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) - message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); - } - if (object.pypiPackages) { - if (typeof object.pypiPackages !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.pypiPackages: object expected"); - message.pypiPackages = {}; - for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) - message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); + var message = new $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig(); + if (object.gkeCluster != null) + message.gkeCluster = String(object.gkeCluster); + if (object.dagGcsPrefix != null) + message.dagGcsPrefix = String(object.dagGcsPrefix); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.fromObject(object.softwareConfig); } - if (object.envVariables) { - if (typeof object.envVariables !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.envVariables: object expected"); - message.envVariables = {}; - for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) - message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.fromObject(object.nodeConfig); + } + if (object.privateEnvironmentConfig != null) { + if (typeof object.privateEnvironmentConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.privateEnvironmentConfig: object expected"); + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); + } + if (object.webServerNetworkAccessControl != null) { + if (typeof object.webServerNetworkAccessControl !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); + } + if (object.databaseConfig != null) { + if (typeof object.databaseConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.databaseConfig: object expected"); + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.fromObject(object.databaseConfig); + } + if (object.webServerConfig != null) { + if (typeof object.webServerConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.webServerConfig: object expected"); + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.fromObject(object.webServerConfig); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.maintenanceWindow != null) { + if (typeof object.maintenanceWindow !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.maintenanceWindow: object expected"); + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.fromObject(object.maintenanceWindow); + } + if (object.workloadsConfig != null) { + if (typeof object.workloadsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.workloadsConfig: object expected"); + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.fromObject(object.workloadsConfig); + } + switch (object.environmentSize) { + default: + if (typeof object.environmentSize === "number") { + message.environmentSize = object.environmentSize; + break; + } + break; + case "ENVIRONMENT_SIZE_UNSPECIFIED": + case 0: + message.environmentSize = 0; + break; + case "ENVIRONMENT_SIZE_SMALL": + case 1: + message.environmentSize = 1; + break; + case "ENVIRONMENT_SIZE_MEDIUM": + case 2: + message.environmentSize = 2; + break; + case "ENVIRONMENT_SIZE_LARGE": + case 3: + message.environmentSize = 3; + break; + } + if (object.airflowUri != null) + message.airflowUri = String(object.airflowUri); + if (object.masterAuthorizedNetworksConfig != null) { + if (typeof object.masterAuthorizedNetworksConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.masterAuthorizedNetworksConfig: object expected"); + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.fromObject(object.masterAuthorizedNetworksConfig); + } + if (object.recoveryConfig != null) { + if (typeof object.recoveryConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.recoveryConfig: object expected"); + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.fromObject(object.recoveryConfig); } - if (object.pythonVersion != null) - message.pythonVersion = String(object.pythonVersion); return message; }; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} message SoftwareConfig + * @param {google.cloud.orchestration.airflow.service.v1.EnvironmentConfig} message EnvironmentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SoftwareConfig.toObject = function toObject(message, options) { + EnvironmentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.airflowConfigOverrides = {}; - object.pypiPackages = {}; - object.envVariables = {}; - } if (options.defaults) { - object.imageVersion = ""; - object.pythonVersion = ""; - } - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - object.imageVersion = message.imageVersion; - var keys2; - if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { - object.airflowConfigOverrides = {}; - for (var j = 0; j < keys2.length; ++j) - object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; - } - if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { - object.pypiPackages = {}; - for (var j = 0; j < keys2.length; ++j) - object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; - } - if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { - object.envVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + object.gkeCluster = ""; + object.dagGcsPrefix = ""; + object.nodeCount = 0; + object.softwareConfig = null; + object.nodeConfig = null; + object.airflowUri = ""; + object.privateEnvironmentConfig = null; + object.webServerNetworkAccessControl = null; + object.databaseConfig = null; + object.webServerConfig = null; + object.encryptionConfig = null; + object.maintenanceWindow = null; + object.workloadsConfig = null; + object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; + object.masterAuthorizedNetworksConfig = null; + object.recoveryConfig = null; } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - object.pythonVersion = message.pythonVersion; + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + object.gkeCluster = message.gkeCluster; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + object.dagGcsPrefix = message.dagGcsPrefix; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig.toObject(message.softwareConfig, options); + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1.NodeConfig.toObject(message.nodeConfig, options); + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + object.airflowUri = message.airflowUri; + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) + object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) + object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) + object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig.toObject(message.databaseConfig, options); + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) + object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig.toObject(message.webServerConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) + object.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.toObject(message.maintenanceWindow, options); + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) + object.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.toObject(message.workloadsConfig, options); + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + object.environmentSize = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] === undefined ? message.environmentSize : $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize[message.environmentSize] : message.environmentSize; + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) + object.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.toObject(message.masterAuthorizedNetworksConfig, options); + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) + object.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig.toObject(message.recoveryConfig, options); return object; }; /** - * Converts this SoftwareConfig to JSON. + * Converts this EnvironmentConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @instance * @returns {Object.} JSON object */ - SoftwareConfig.prototype.toJSON = function toJSON() { + EnvironmentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for EnvironmentConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EnvironmentConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SoftwareConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EnvironmentConfig"; }; - return SoftwareConfig; + /** + * EnvironmentSize enum. + * @name google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.EnvironmentSize + * @enum {number} + * @property {number} ENVIRONMENT_SIZE_UNSPECIFIED=0 ENVIRONMENT_SIZE_UNSPECIFIED value + * @property {number} ENVIRONMENT_SIZE_SMALL=1 ENVIRONMENT_SIZE_SMALL value + * @property {number} ENVIRONMENT_SIZE_MEDIUM=2 ENVIRONMENT_SIZE_MEDIUM value + * @property {number} ENVIRONMENT_SIZE_LARGE=3 ENVIRONMENT_SIZE_LARGE value + */ + EnvironmentConfig.EnvironmentSize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENVIRONMENT_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENVIRONMENT_SIZE_SMALL"] = 1; + values[valuesById[2] = "ENVIRONMENT_SIZE_MEDIUM"] = 2; + values[valuesById[3] = "ENVIRONMENT_SIZE_LARGE"] = 3; + return values; + })(); + + return EnvironmentConfig; })(); - v1.IPAllocationPolicy = (function() { + v1.WebServerNetworkAccessControl = (function() { /** - * Properties of a IPAllocationPolicy. + * Properties of a WebServerNetworkAccessControl. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IIPAllocationPolicy - * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases - * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName - * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock - * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName - * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock + * @interface IWebServerNetworkAccessControl + * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges */ /** - * Constructs a new IPAllocationPolicy. + * Constructs a new WebServerNetworkAccessControl. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a IPAllocationPolicy. - * @implements IIPAllocationPolicy + * @classdesc Represents a WebServerNetworkAccessControl. + * @implements IWebServerNetworkAccessControl * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set */ - function IPAllocationPolicy(properties) { + function WebServerNetworkAccessControl(properties) { + this.allowedIpRanges = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3639,156 +3347,78 @@ } /** - * IPAllocationPolicy useIpAliases. - * @member {boolean} useIpAliases - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * WebServerNetworkAccessControl allowedIpRanges. + * @member {Array.} allowedIpRanges + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @instance */ - IPAllocationPolicy.prototype.useIpAliases = false; + WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; /** - * IPAllocationPolicy clusterSecondaryRangeName. - * @member {string|null|undefined} clusterSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance + * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance */ - IPAllocationPolicy.prototype.clusterSecondaryRangeName = null; + WebServerNetworkAccessControl.create = function create(properties) { + return new WebServerNetworkAccessControl(properties); + }; /** - * IPAllocationPolicy clusterIpv4CidrBlock. - * @member {string|null|undefined} clusterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.prototype.clusterIpv4CidrBlock = null; + WebServerNetworkAccessControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedIpRanges != null && message.allowedIpRanges.length) + for (var i = 0; i < message.allowedIpRanges.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * IPAllocationPolicy servicesSecondaryRangeName. - * @member {string|null|undefined} servicesSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.prototype.servicesSecondaryRangeName = null; + WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * IPAllocationPolicy servicesIpv4CidrBlock. - * @member {string|null|undefined} servicesIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.servicesIpv4CidrBlock = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * IPAllocationPolicy clusterIpAllocation. - * @member {"clusterSecondaryRangeName"|"clusterIpv4CidrBlock"|undefined} clusterIpAllocation - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - Object.defineProperty(IPAllocationPolicy.prototype, "clusterIpAllocation", { - get: $util.oneOfGetter($oneOfFields = ["clusterSecondaryRangeName", "clusterIpv4CidrBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * IPAllocationPolicy servicesIpAllocation. - * @member {"servicesSecondaryRangeName"|"servicesIpv4CidrBlock"|undefined} servicesIpAllocation - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @instance - */ - Object.defineProperty(IPAllocationPolicy.prototype, "servicesIpAllocation", { - get: $util.oneOfGetter($oneOfFields = ["servicesSecondaryRangeName", "servicesIpv4CidrBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new IPAllocationPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy instance - */ - IPAllocationPolicy.create = function create(properties) { - return new IPAllocationPolicy(properties); - }; - - /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IPAllocationPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); - if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); - if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); - if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); - if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); - return writer; - }; - - /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy - * @static - * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decode = function decode(reader, length) { + WebServerNetworkAccessControl.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.orchestration.airflow.service.v1.IPAllocationPolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.useIpAliases = reader.bool(); - break; - } - case 2: { - message.clusterSecondaryRangeName = reader.string(); - break; - } - case 4: { - message.clusterIpv4CidrBlock = reader.string(); - break; - } - case 3: { - message.servicesSecondaryRangeName = reader.string(); - break; - } - case 5: { - message.servicesIpv4CidrBlock = reader.string(); + if (!(message.allowedIpRanges && message.allowedIpRanges.length)) + message.allowedIpRanges = []; + message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); break; } default: @@ -3800,185 +3430,366 @@ }; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a IPAllocationPolicy message. + * Verifies a WebServerNetworkAccessControl message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IPAllocationPolicy.verify = function verify(message) { + WebServerNetworkAccessControl.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - if (typeof message.useIpAliases !== "boolean") - return "useIpAliases: boolean expected"; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { - properties.clusterIpAllocation = 1; - if (!$util.isString(message.clusterSecondaryRangeName)) - return "clusterSecondaryRangeName: string expected"; - } - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { - if (properties.clusterIpAllocation === 1) - return "clusterIpAllocation: multiple values"; - properties.clusterIpAllocation = 1; - if (!$util.isString(message.clusterIpv4CidrBlock)) - return "clusterIpv4CidrBlock: string expected"; - } - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { - properties.servicesIpAllocation = 1; - if (!$util.isString(message.servicesSecondaryRangeName)) - return "servicesSecondaryRangeName: string expected"; - } - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { - if (properties.servicesIpAllocation === 1) - return "servicesIpAllocation: multiple values"; - properties.servicesIpAllocation = 1; - if (!$util.isString(message.servicesIpv4CidrBlock)) - return "servicesIpv4CidrBlock: string expected"; + if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { + if (!Array.isArray(message.allowedIpRanges)) + return "allowedIpRanges: array expected"; + for (var i = 0; i < message.allowedIpRanges.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); + if (error) + return "allowedIpRanges." + error; + } } return null; }; /** - * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} WebServerNetworkAccessControl */ - IPAllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy) + WebServerNetworkAccessControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); - if (object.useIpAliases != null) - message.useIpAliases = Boolean(object.useIpAliases); - if (object.clusterSecondaryRangeName != null) - message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); - if (object.clusterIpv4CidrBlock != null) - message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); - if (object.servicesSecondaryRangeName != null) - message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); - if (object.servicesIpv4CidrBlock != null) - message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl(); + if (object.allowedIpRanges) { + if (!Array.isArray(object.allowedIpRanges)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); + message.allowedIpRanges = []; + for (var i = 0; i < object.allowedIpRanges.length; ++i) { + if (typeof object.allowedIpRanges[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); + message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); + } + } return message; }; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} message IPAllocationPolicy + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IPAllocationPolicy.toObject = function toObject(message, options) { + WebServerNetworkAccessControl.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.useIpAliases = false; - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - object.useIpAliases = message.useIpAliases; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { - object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; - if (options.oneofs) - object.clusterIpAllocation = "clusterSecondaryRangeName"; - } - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { - object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; - if (options.oneofs) - object.servicesIpAllocation = "servicesSecondaryRangeName"; - } - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { - object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; - if (options.oneofs) - object.clusterIpAllocation = "clusterIpv4CidrBlock"; - } - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { - object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; - if (options.oneofs) - object.servicesIpAllocation = "servicesIpv4CidrBlock"; + if (options.arrays || options.defaults) + object.allowedIpRanges = []; + if (message.allowedIpRanges && message.allowedIpRanges.length) { + object.allowedIpRanges = []; + for (var j = 0; j < message.allowedIpRanges.length; ++j) + object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); } return object; }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this WebServerNetworkAccessControl to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @instance * @returns {Object.} JSON object */ - IPAllocationPolicy.prototype.toJSON = function toJSON() { + WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for WebServerNetworkAccessControl * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl"; }; - return IPAllocationPolicy; - })(); + WebServerNetworkAccessControl.AllowedIpRange = (function() { - v1.NodeConfig = (function() { + /** + * Properties of an AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @interface IAllowedIpRange + * @property {string|null} [value] AllowedIpRange value + * @property {string|null} [description] AllowedIpRange description + */ - /** - * Properties of a NodeConfig. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface INodeConfig - * @property {string|null} [location] NodeConfig location - * @property {string|null} [machineType] NodeConfig machineType - * @property {string|null} [network] NodeConfig network - * @property {string|null} [subnetwork] NodeConfig subnetwork - * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb - * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes - * @property {string|null} [serviceAccount] NodeConfig serviceAccount - * @property {Array.|null} [tags] NodeConfig tags - * @property {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy + /** + * Constructs a new AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl + * @classdesc Represents an AllowedIpRange. + * @implements IAllowedIpRange + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + */ + function AllowedIpRange(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]]; + } + + /** + * AllowedIpRange value. + * @member {string} value + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.value = ""; + + /** + * AllowedIpRange description. + * @member {string} description + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.description = ""; + + /** + * Creates a new AllowedIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance + */ + AllowedIpRange.create = function create(properties) { + return new AllowedIpRange(properties); + }; + + /** + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.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.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedIpRange message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + */ + AllowedIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange(); + if (object.value != null) + message.value = String(object.value); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.description = ""; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AllowedIpRange to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + * @returns {Object.} JSON object + */ + AllowedIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedIpRange + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerNetworkAccessControl.AllowedIpRange"; + }; + + return AllowedIpRange; + })(); + + return WebServerNetworkAccessControl; + })(); + + v1.DatabaseConfig = (function() { + + /** + * Properties of a DatabaseConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IDatabaseConfig + * @property {string|null} [machineType] DatabaseConfig machineType */ /** - * Constructs a new NodeConfig. + * Constructs a new DatabaseConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a NodeConfig. - * @implements INodeConfig + * @classdesc Represents a DatabaseConfig. + * @implements IDatabaseConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set */ - function NodeConfig(properties) { - this.oauthScopes = []; - this.tags = []; + function DatabaseConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3986,195 +3797,77 @@ } /** - * NodeConfig location. - * @member {string} location - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.location = ""; - - /** - * NodeConfig machineType. + * DatabaseConfig machineType. * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @instance */ - NodeConfig.prototype.machineType = ""; + DatabaseConfig.prototype.machineType = ""; /** - * NodeConfig network. - * @member {string} network - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.network = ""; - - /** - * NodeConfig subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.subnetwork = ""; - - /** - * NodeConfig diskSizeGb. - * @member {number} diskSizeGb - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.diskSizeGb = 0; - - /** - * NodeConfig oauthScopes. - * @member {Array.} oauthScopes - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.oauthScopes = $util.emptyArray; - - /** - * NodeConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.serviceAccount = ""; - - /** - * NodeConfig tags. - * @member {Array.} tags - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.tags = $util.emptyArray; - - /** - * NodeConfig ipAllocationPolicy. - * @member {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig - * @instance - */ - NodeConfig.prototype.ipAllocationPolicy = null; - - /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new DatabaseConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig instance */ - NodeConfig.create = function create(properties) { - return new NodeConfig(properties); + DatabaseConfig.create = function create(properties) { + return new DatabaseConfig(properties); }; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encode = function encode(message, writer) { + DatabaseConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); - if (message.oauthScopes != null && message.oauthScopes.length) - for (var i = 0; i < message.oauthScopes.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) - $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); return writer; }; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.DatabaseConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IDatabaseConfig} message DatabaseConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes a DatabaseConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decode = function decode(reader, length) { + DatabaseConfig.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.orchestration.airflow.service.v1.NodeConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.location = reader.string(); - break; - } - case 2: { message.machineType = reader.string(); break; } - case 3: { - message.network = reader.string(); - break; - } - case 4: { - message.subnetwork = reader.string(); - break; - } - case 5: { - message.diskSizeGb = reader.int32(); - break; - } - case 6: { - if (!(message.oauthScopes && message.oauthScopes.length)) - message.oauthScopes = []; - message.oauthScopes.push(reader.string()); - break; - } - case 7: { - message.serviceAccount = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 9: { - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -4184,220 +3877,122 @@ }; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decodeDelimited = function decodeDelimited(reader) { + DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeConfig message. + * Verifies a DatabaseConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeConfig.verify = function verify(message) { + DatabaseConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; if (message.machineType != null && message.hasOwnProperty("machineType")) if (!$util.isString(message.machineType)) return "machineType: string expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb)) - return "diskSizeGb: integer expected"; - if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { - if (!Array.isArray(message.oauthScopes)) - return "oauthScopes: array expected"; - for (var i = 0; i < message.oauthScopes.length; ++i) - if (!$util.isString(message.oauthScopes[i])) - return "oauthScopes: string[] expected"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; - } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify(message.ipAllocationPolicy); - if (error) - return "ipAllocationPolicy." + error; - } return null; }; /** - * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} DatabaseConfig */ - NodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NodeConfig) + DatabaseConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); - if (object.location != null) - message.location = String(object.location); + var message = new $root.google.cloud.orchestration.airflow.service.v1.DatabaseConfig(); if (object.machineType != null) message.machineType = String(object.machineType); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.diskSizeGb != null) - message.diskSizeGb = object.diskSizeGb | 0; - if (object.oauthScopes) { - if (!Array.isArray(object.oauthScopes)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.oauthScopes: array expected"); - message.oauthScopes = []; - for (var i = 0; i < object.oauthScopes.length; ++i) - message.oauthScopes[i] = String(object.oauthScopes[i]); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.ipAllocationPolicy != null) { - if (typeof object.ipAllocationPolicy !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.ipAllocationPolicy: object expected"); - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); - } return message; }; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.NodeConfig} message NodeConfig + * @param {google.cloud.orchestration.airflow.service.v1.DatabaseConfig} message DatabaseConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeConfig.toObject = function toObject(message, options) { + DatabaseConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.oauthScopes = []; - object.tags = []; - } - if (options.defaults) { - object.location = ""; + if (options.defaults) object.machineType = ""; - object.network = ""; - object.subnetwork = ""; - object.diskSizeGb = 0; - object.serviceAccount = ""; - object.ipAllocationPolicy = null; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; if (message.machineType != null && message.hasOwnProperty("machineType")) object.machineType = message.machineType; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - object.diskSizeGb = message.diskSizeGb; - if (message.oauthScopes && message.oauthScopes.length) { - object.oauthScopes = []; - for (var j = 0; j < message.oauthScopes.length; ++j) - object.oauthScopes[j] = message.oauthScopes[j]; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) - object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); return object; }; /** - * Converts this NodeConfig to JSON. + * Converts this DatabaseConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @instance * @returns {Object.} JSON object */ - NodeConfig.prototype.toJSON = function toJSON() { + DatabaseConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for DatabaseConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.DatabaseConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NodeConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.DatabaseConfig"; }; - return NodeConfig; + return DatabaseConfig; })(); - v1.PrivateClusterConfig = (function() { + v1.WebServerConfig = (function() { /** - * Properties of a PrivateClusterConfig. + * Properties of a WebServerConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IPrivateClusterConfig - * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint - * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock - * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange + * @interface IWebServerConfig + * @property {string|null} [machineType] WebServerConfig machineType */ /** - * Constructs a new PrivateClusterConfig. + * Constructs a new WebServerConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a PrivateClusterConfig. - * @implements IPrivateClusterConfig + * @classdesc Represents a WebServerConfig. + * @implements IWebServerConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set */ - function PrivateClusterConfig(properties) { + function WebServerConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4405,103 +4000,75 @@ } /** - * PrivateClusterConfig enablePrivateEndpoint. - * @member {boolean} enablePrivateEndpoint - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig - * @instance - */ - PrivateClusterConfig.prototype.enablePrivateEndpoint = false; - - /** - * PrivateClusterConfig masterIpv4CidrBlock. - * @member {string} masterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig - * @instance - */ - PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; - - /** - * PrivateClusterConfig masterIpv4ReservedRange. - * @member {string} masterIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * WebServerConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @instance */ - PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; + WebServerConfig.prototype.machineType = ""; /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * Creates a new WebServerConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig instance */ - PrivateClusterConfig.create = function create(properties) { - return new PrivateClusterConfig(properties); + WebServerConfig.create = function create(properties) { + return new WebServerConfig(properties); }; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encode = function encode(message, writer) { + WebServerConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); - if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); - if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); return writer; }; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WebServerConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IWebServerConfig} message WebServerConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes a WebServerConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decode = function decode(reader, length) { + WebServerConfig.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.orchestration.airflow.service.v1.PrivateClusterConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enablePrivateEndpoint = reader.bool(); - break; - } - case 2: { - message.masterIpv4CidrBlock = reader.string(); - break; - } - case 3: { - message.masterIpv4ReservedRange = reader.string(); + message.machineType = reader.string(); break; } default: @@ -4513,143 +4080,122 @@ }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + WebServerConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateClusterConfig message. + * Verifies a WebServerConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateClusterConfig.verify = function verify(message) { + WebServerConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - if (typeof message.enablePrivateEndpoint !== "boolean") - return "enablePrivateEndpoint: boolean expected"; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - if (!$util.isString(message.masterIpv4CidrBlock)) - return "masterIpv4CidrBlock: string expected"; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - if (!$util.isString(message.masterIpv4ReservedRange)) - return "masterIpv4ReservedRange: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; return null; }; /** - * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.WebServerConfig} WebServerConfig */ - PrivateClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig) + WebServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); - if (object.enablePrivateEndpoint != null) - message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); - if (object.masterIpv4CidrBlock != null) - message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); - if (object.masterIpv4ReservedRange != null) - message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); + var message = new $root.google.cloud.orchestration.airflow.service.v1.WebServerConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); return message; }; /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} message PrivateClusterConfig + * @param {google.cloud.orchestration.airflow.service.v1.WebServerConfig} message WebServerConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivateClusterConfig.toObject = function toObject(message, options) { + WebServerConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.enablePrivateEndpoint = false; - object.masterIpv4CidrBlock = ""; - object.masterIpv4ReservedRange = ""; - } - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - object.enablePrivateEndpoint = message.enablePrivateEndpoint; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; + if (options.defaults) + object.machineType = ""; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; return object; }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this WebServerConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @instance * @returns {Object.} JSON object */ - PrivateClusterConfig.prototype.toJSON = function toJSON() { + WebServerConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for WebServerConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.WebServerConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WebServerConfig"; }; - return PrivateClusterConfig; + return WebServerConfig; })(); - v1.PrivateEnvironmentConfig = (function() { + v1.EncryptionConfig = (function() { /** - * Properties of a PrivateEnvironmentConfig. + * Properties of an EncryptionConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IPrivateEnvironmentConfig - * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment - * @property {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig - * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock - * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock - * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName */ /** - * Constructs a new PrivateEnvironmentConfig. + * Constructs a new EncryptionConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a PrivateEnvironmentConfig. - * @implements IPrivateEnvironmentConfig + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set */ - function PrivateEnvironmentConfig(properties) { + function EncryptionConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4657,131 +4203,75 @@ } /** - * PrivateEnvironmentConfig enablePrivateEnvironment. - * @member {boolean} enablePrivateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @instance */ - PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; - - /** - * PrivateEnvironmentConfig privateClusterConfig. - * @member {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null|undefined} privateClusterConfig - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.privateClusterConfig = null; - - /** - * PrivateEnvironmentConfig webServerIpv4CidrBlock. - * @member {string} webServerIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; - - /** - * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. - * @member {string} cloudSqlIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; - - /** - * PrivateEnvironmentConfig webServerIpv4ReservedRange. - * @member {string} webServerIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; + EncryptionConfig.prototype.kmsKeyName = ""; /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * Creates a new EncryptionConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig instance */ - PrivateEnvironmentConfig.create = function create(properties) { - return new PrivateEnvironmentConfig(properties); + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); }; /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateEnvironmentConfig.encode = function encode(message, writer) { + EncryptionConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); - if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) - $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); - if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); - if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); return writer; }; /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.EncryptionConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * Decodes an EncryptionConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateEnvironmentConfig.decode = function decode(reader, length) { + EncryptionConfig.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.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enablePrivateEnvironment = reader.bool(); - break; - } - case 2: { - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.webServerIpv4CidrBlock = reader.string(); - break; - } - case 4: { - message.cloudSqlIpv4CidrBlock = reader.string(); - break; - } - case 5: { - message.webServerIpv4ReservedRange = reader.string(); + message.kmsKeyName = reader.string(); break; } default: @@ -4793,167 +4283,124 @@ }; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateEnvironmentConfig message. + * Verifies an EncryptionConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateEnvironmentConfig.verify = function verify(message) { + EncryptionConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - if (typeof message.enablePrivateEnvironment !== "boolean") - return "enablePrivateEnvironment: boolean expected"; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify(message.privateClusterConfig); - if (error) - return "privateClusterConfig." + error; - } - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - if (!$util.isString(message.webServerIpv4CidrBlock)) - return "webServerIpv4CidrBlock: string expected"; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - if (!$util.isString(message.cloudSqlIpv4CidrBlock)) - return "cloudSqlIpv4CidrBlock: string expected"; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - if (!$util.isString(message.webServerIpv4ReservedRange)) - return "webServerIpv4ReservedRange: string expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; return null; }; /** - * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} EncryptionConfig */ - PrivateEnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig) + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); - if (object.enablePrivateEnvironment != null) - message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); - if (object.privateClusterConfig != null) { - if (typeof object.privateClusterConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.fromObject(object.privateClusterConfig); - } - if (object.webServerIpv4CidrBlock != null) - message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); - if (object.cloudSqlIpv4CidrBlock != null) - message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); - if (object.webServerIpv4ReservedRange != null) - message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); + var message = new $root.google.cloud.orchestration.airflow.service.v1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); return message; }; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig + * @param {google.cloud.orchestration.airflow.service.v1.EncryptionConfig} message EncryptionConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrivateEnvironmentConfig.toObject = function toObject(message, options) { + EncryptionConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.enablePrivateEnvironment = false; - object.privateClusterConfig = null; - object.webServerIpv4CidrBlock = ""; - object.cloudSqlIpv4CidrBlock = ""; - object.webServerIpv4ReservedRange = ""; - } - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - object.enablePrivateEnvironment = message.enablePrivateEnvironment; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) - object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; return object; }; /** - * Converts this PrivateEnvironmentConfig to JSON. + * Converts this EncryptionConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @instance * @returns {Object.} JSON object */ - PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { + EncryptionConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateEnvironmentConfig + * Gets the default type url for EncryptionConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.EncryptionConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.EncryptionConfig"; }; - return PrivateEnvironmentConfig; + return EncryptionConfig; })(); - v1.Environment = (function() { + v1.MaintenanceWindow = (function() { /** - * Properties of an Environment. + * Properties of a MaintenanceWindow. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IEnvironment - * @property {string|null} [name] Environment name - * @property {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null} [config] Environment config - * @property {string|null} [uuid] Environment uuid - * @property {google.cloud.orchestration.airflow.service.v1.Environment.State|null} [state] Environment state - * @property {google.protobuf.ITimestamp|null} [createTime] Environment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime - * @property {Object.|null} [labels] Environment labels + * @interface IMaintenanceWindow + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceWindow endTime + * @property {string|null} [recurrence] MaintenanceWindow recurrence */ /** - * Constructs a new Environment. + * Constructs a new MaintenanceWindow. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an Environment. - * @implements IEnvironment + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set */ - function Environment(properties) { - this.labels = {}; + function MaintenanceWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4961,179 +4408,103 @@ } /** - * Environment name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * MaintenanceWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @instance */ - Environment.prototype.name = ""; + MaintenanceWindow.prototype.startTime = null; /** - * Environment config. - * @member {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null|undefined} config - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * MaintenanceWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @instance */ - Environment.prototype.config = null; + MaintenanceWindow.prototype.endTime = null; /** - * Environment uuid. - * @member {string} uuid - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * MaintenanceWindow recurrence. + * @member {string} recurrence + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @instance */ - Environment.prototype.uuid = ""; + MaintenanceWindow.prototype.recurrence = ""; /** - * Environment state. - * @member {google.cloud.orchestration.airflow.service.v1.Environment.State} state - * @memberof google.cloud.orchestration.airflow.service.v1.Environment - * @instance - */ - Environment.prototype.state = 0; - - /** - * Environment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.orchestration.airflow.service.v1.Environment - * @instance - */ - Environment.prototype.createTime = null; - - /** - * Environment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.orchestration.airflow.service.v1.Environment - * @instance - */ - Environment.prototype.updateTime = null; - - /** - * Environment labels. - * @member {Object.} labels - * @memberof google.cloud.orchestration.airflow.service.v1.Environment - * @instance - */ - Environment.prototype.labels = $util.emptyObject; - - /** - * Creates a new Environment instance using the specified properties. + * Creates a new MaintenanceWindow instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment instance + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow instance */ - Environment.create = function create(properties) { - return new Environment(properties); + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); }; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encode = function encode(message, writer) { + MaintenanceWindow.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.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.uuid); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recurrence); return writer; }; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static - * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a MaintenanceWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decode = function decode(reader, length) { + MaintenanceWindow.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.orchestration.airflow.service.v1.Environment(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.decode(reader, reader.uint32()); + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.uuid = reader.string(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - 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.recurrence = reader.string(); break; } default: @@ -5145,267 +4516,157 @@ }; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decodeDelimited = function decodeDelimited(reader) { + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Environment message. + * Verifies a MaintenanceWindow message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Environment.verify = function verify(message) { + MaintenanceWindow.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.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) - return "createTime." + error; + return "startTime." + error; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); if (error) - return "updateTime." + 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 "endTime." + error; } + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + if (!$util.isString(message.recurrence)) + return "recurrence: string expected"; return null; }; /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment + * @returns {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} MaintenanceWindow */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.Environment) + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(); - if (object.name != null) - message.name = String(object.name); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.config: object expected"); - message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.fromObject(object.config); - } - if (object.uuid != null) - message.uuid = String(object.uuid); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "ERROR": - case 5: - message.state = 5; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + var message = new $root.google.cloud.orchestration.airflow.service.v1.MaintenanceWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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]]); + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MaintenanceWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } + if (object.recurrence != null) + message.recurrence = String(object.recurrence); return message; }; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static - * @param {google.cloud.orchestration.airflow.service.v1.Environment} message Environment + * @param {google.cloud.orchestration.airflow.service.v1.MaintenanceWindow} message MaintenanceWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Environment.toObject = function toObject(message, options) { + MaintenanceWindow.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.name = ""; - object.config = null; - object.uuid = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.toObject(message.config, options); - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, 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]]; + object.startTime = null; + object.endTime = null; + object.recurrence = ""; } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + object.recurrence = message.recurrence; return object; }; /** - * Converts this Environment to JSON. + * Converts this MaintenanceWindow to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @instance * @returns {Object.} JSON object */ - Environment.prototype.toJSON = function toJSON() { + MaintenanceWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Environment + * Gets the default type url for MaintenanceWindow * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.Environment + * @memberof google.cloud.orchestration.airflow.service.v1.MaintenanceWindow * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.Environment"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MaintenanceWindow"; }; - /** - * State enum. - * @name google.cloud.orchestration.airflow.service.v1.Environment.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} UPDATING=3 UPDATING value - * @property {number} DELETING=4 DELETING value - * @property {number} ERROR=5 ERROR value - */ - Environment.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "ERROR"] = 5; - return values; - })(); - - return Environment; + return MaintenanceWindow; })(); - v1.CheckUpgradeResponse = (function() { + v1.SoftwareConfig = (function() { /** - * Properties of a CheckUpgradeResponse. + * Properties of a SoftwareConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface ICheckUpgradeResponse - * @property {string|null} [buildLogUri] CheckUpgradeResponse buildLogUri - * @property {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null} [containsPypiModulesConflict] CheckUpgradeResponse containsPypiModulesConflict - * @property {string|null} [pypiConflictBuildLogExtract] CheckUpgradeResponse pypiConflictBuildLogExtract - * @property {string|null} [imageVersion] CheckUpgradeResponse imageVersion - * @property {Object.|null} [pypiDependencies] CheckUpgradeResponse pypiDependencies + * @interface ISoftwareConfig + * @property {string|null} [imageVersion] SoftwareConfig imageVersion + * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides + * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages + * @property {Object.|null} [envVariables] SoftwareConfig envVariables + * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion + * @property {number|null} [schedulerCount] SoftwareConfig schedulerCount */ /** - * Constructs a new CheckUpgradeResponse. + * Constructs a new SoftwareConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a CheckUpgradeResponse. - * @implements ICheckUpgradeResponse + * @classdesc Represents a SoftwareConfig. + * @implements ISoftwareConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set */ - function CheckUpgradeResponse(properties) { - this.pypiDependencies = {}; + function SoftwareConfig(properties) { + this.airflowConfigOverrides = {}; + this.pypiPackages = {}; + this.envVariables = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5413,133 +4674,156 @@ } /** - * CheckUpgradeResponse buildLogUri. - * @member {string} buildLogUri - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * SoftwareConfig imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance */ - CheckUpgradeResponse.prototype.buildLogUri = ""; + SoftwareConfig.prototype.imageVersion = ""; /** - * CheckUpgradeResponse containsPypiModulesConflict. - * @member {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult} containsPypiModulesConflict - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * SoftwareConfig airflowConfigOverrides. + * @member {Object.} airflowConfigOverrides + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance */ - CheckUpgradeResponse.prototype.containsPypiModulesConflict = 0; + SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; /** - * CheckUpgradeResponse pypiConflictBuildLogExtract. - * @member {string} pypiConflictBuildLogExtract - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * SoftwareConfig pypiPackages. + * @member {Object.} pypiPackages + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance */ - CheckUpgradeResponse.prototype.pypiConflictBuildLogExtract = ""; + SoftwareConfig.prototype.pypiPackages = $util.emptyObject; /** - * CheckUpgradeResponse imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * SoftwareConfig envVariables. + * @member {Object.} envVariables + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance */ - CheckUpgradeResponse.prototype.imageVersion = ""; + SoftwareConfig.prototype.envVariables = $util.emptyObject; /** - * CheckUpgradeResponse pypiDependencies. - * @member {Object.} pypiDependencies - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * SoftwareConfig pythonVersion. + * @member {string} pythonVersion + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance */ - CheckUpgradeResponse.prototype.pypiDependencies = $util.emptyObject; + SoftwareConfig.prototype.pythonVersion = ""; /** - * Creates a new CheckUpgradeResponse instance using the specified properties. + * SoftwareConfig schedulerCount. + * @member {number} schedulerCount + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.schedulerCount = 0; + + /** + * Creates a new SoftwareConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse instance + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig instance */ - CheckUpgradeResponse.create = function create(properties) { - return new CheckUpgradeResponse(properties); + SoftwareConfig.create = function create(properties) { + return new SoftwareConfig(properties); }; /** - * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CheckUpgradeResponse.encode = function encode(message, writer) { + SoftwareConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.buildLogUri != null && Object.hasOwnProperty.call(message, "buildLogUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildLogUri); - if (message.pypiConflictBuildLogExtract != null && Object.hasOwnProperty.call(message, "pypiConflictBuildLogExtract")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pypiConflictBuildLogExtract); - if (message.containsPypiModulesConflict != null && Object.hasOwnProperty.call(message, "containsPypiModulesConflict")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.containsPypiModulesConflict); if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.imageVersion); - if (message.pypiDependencies != null && Object.hasOwnProperty.call(message, "pypiDependencies")) - for (var keys = Object.keys(message.pypiDependencies), 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.pypiDependencies[keys[i]]).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); + if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) + for (var keys = Object.keys(message.airflowConfigOverrides), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.airflowConfigOverrides[keys[i]]).ldelim(); + if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) + for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); + if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) + for (var keys = Object.keys(message.envVariables), 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.envVariables[keys[i]]).ldelim(); + if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); + if (message.schedulerCount != null && Object.hasOwnProperty.call(message, "schedulerCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.schedulerCount); return writer; }; /** - * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.SoftwareConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CheckUpgradeResponse.encodeDelimited = function encodeDelimited(message, writer) { + SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer. + * Decodes a SoftwareConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CheckUpgradeResponse.decode = function decode(reader, length) { + SoftwareConfig.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.orchestration.airflow.service.v1.CheckUpgradeResponse(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.buildLogUri = reader.string(); + message.imageVersion = reader.string(); break; } - case 4: { - message.containsPypiModulesConflict = reader.int32(); + case 2: { + if (message.airflowConfigOverrides === $util.emptyObject) + message.airflowConfigOverrides = {}; + 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.airflowConfigOverrides[key] = value; break; } case 3: { - message.pypiConflictBuildLogExtract = reader.string(); - break; - } - case 5: { - message.imageVersion = reader.string(); - break; - } - case 6: { - if (message.pypiDependencies === $util.emptyObject) - message.pypiDependencies = {}; + if (message.pypiPackages === $util.emptyObject) + message.pypiPackages = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; @@ -5557,411 +4841,409 @@ break; } } - message.pypiDependencies[key] = value; + message.pypiPackages[key] = value; break; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse - * @throws {Error} If the payload is not a reader or valid buffer + case 4: { + if (message.envVariables === $util.emptyObject) + message.envVariables = {}; + 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.envVariables[key] = value; + break; + } + case 6: { + message.pythonVersion = reader.string(); + break; + } + case 7: { + message.schedulerCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CheckUpgradeResponse.decodeDelimited = function decodeDelimited(reader) { + SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CheckUpgradeResponse message. + * Verifies a SoftwareConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CheckUpgradeResponse.verify = function verify(message) { + SoftwareConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) - if (!$util.isString(message.buildLogUri)) - return "buildLogUri: string expected"; - if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) - switch (message.containsPypiModulesConflict) { - default: - return "containsPypiModulesConflict: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) - if (!$util.isString(message.pypiConflictBuildLogExtract)) - return "pypiConflictBuildLogExtract: string expected"; if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) if (!$util.isString(message.imageVersion)) return "imageVersion: string expected"; - if (message.pypiDependencies != null && message.hasOwnProperty("pypiDependencies")) { - if (!$util.isObject(message.pypiDependencies)) - return "pypiDependencies: object expected"; - var key = Object.keys(message.pypiDependencies); + if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { + if (!$util.isObject(message.airflowConfigOverrides)) + return "airflowConfigOverrides: object expected"; + var key = Object.keys(message.airflowConfigOverrides); for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.pypiDependencies[key[i]])) - return "pypiDependencies: string{k:string} expected"; + if (!$util.isString(message.airflowConfigOverrides[key[i]])) + return "airflowConfigOverrides: string{k:string} expected"; + } + if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { + if (!$util.isObject(message.pypiPackages)) + return "pypiPackages: object expected"; + var key = Object.keys(message.pypiPackages); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.pypiPackages[key[i]])) + return "pypiPackages: string{k:string} expected"; + } + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!$util.isObject(message.envVariables)) + return "envVariables: object expected"; + var key = Object.keys(message.envVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.envVariables[key[i]])) + return "envVariables: string{k:string} expected"; } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + if (!$util.isString(message.pythonVersion)) + return "pythonVersion: string expected"; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + if (!$util.isInteger(message.schedulerCount)) + return "schedulerCount: integer expected"; return null; }; /** - * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse + * @returns {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} SoftwareConfig */ - CheckUpgradeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse) + SoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(); - if (object.buildLogUri != null) - message.buildLogUri = String(object.buildLogUri); - switch (object.containsPypiModulesConflict) { - default: - if (typeof object.containsPypiModulesConflict === "number") { - message.containsPypiModulesConflict = object.containsPypiModulesConflict; - break; - } - break; - case "CONFLICT_RESULT_UNSPECIFIED": - case 0: - message.containsPypiModulesConflict = 0; - break; - case "CONFLICT": - case 1: - message.containsPypiModulesConflict = 1; - break; - case "NO_CONFLICT": - case 2: - message.containsPypiModulesConflict = 2; - break; - } - if (object.pypiConflictBuildLogExtract != null) - message.pypiConflictBuildLogExtract = String(object.pypiConflictBuildLogExtract); + var message = new $root.google.cloud.orchestration.airflow.service.v1.SoftwareConfig(); if (object.imageVersion != null) message.imageVersion = String(object.imageVersion); - if (object.pypiDependencies) { - if (typeof object.pypiDependencies !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.pypiDependencies: object expected"); - message.pypiDependencies = {}; - for (var keys = Object.keys(object.pypiDependencies), i = 0; i < keys.length; ++i) - message.pypiDependencies[keys[i]] = String(object.pypiDependencies[keys[i]]); + if (object.airflowConfigOverrides) { + if (typeof object.airflowConfigOverrides !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.airflowConfigOverrides: object expected"); + message.airflowConfigOverrides = {}; + for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) + message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); + } + if (object.pypiPackages) { + if (typeof object.pypiPackages !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.pypiPackages: object expected"); + message.pypiPackages = {}; + for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) + message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); + } + if (object.envVariables) { + if (typeof object.envVariables !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.SoftwareConfig.envVariables: object expected"); + message.envVariables = {}; + for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) + message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); } + if (object.pythonVersion != null) + message.pythonVersion = String(object.pythonVersion); + if (object.schedulerCount != null) + message.schedulerCount = object.schedulerCount | 0; return message; }; /** - * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} message CheckUpgradeResponse + * @param {google.cloud.orchestration.airflow.service.v1.SoftwareConfig} message SoftwareConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CheckUpgradeResponse.toObject = function toObject(message, options) { + SoftwareConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.pypiDependencies = {}; + if (options.objects || options.defaults) { + object.airflowConfigOverrides = {}; + object.pypiPackages = {}; + object.envVariables = {}; + } if (options.defaults) { - object.buildLogUri = ""; - object.pypiConflictBuildLogExtract = ""; - object.containsPypiModulesConflict = options.enums === String ? "CONFLICT_RESULT_UNSPECIFIED" : 0; object.imageVersion = ""; + object.pythonVersion = ""; + object.schedulerCount = 0; } - if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) - object.buildLogUri = message.buildLogUri; - if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) - object.pypiConflictBuildLogExtract = message.pypiConflictBuildLogExtract; - if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) - object.containsPypiModulesConflict = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] === undefined ? message.containsPypiModulesConflict : $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] : message.containsPypiModulesConflict; if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) object.imageVersion = message.imageVersion; var keys2; - if (message.pypiDependencies && (keys2 = Object.keys(message.pypiDependencies)).length) { - object.pypiDependencies = {}; + if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { + object.airflowConfigOverrides = {}; for (var j = 0; j < keys2.length; ++j) - object.pypiDependencies[keys2[j]] = message.pypiDependencies[keys2[j]]; + object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; + } + if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { + object.pypiPackages = {}; + for (var j = 0; j < keys2.length; ++j) + object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; } + if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { + object.envVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + object.pythonVersion = message.pythonVersion; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + object.schedulerCount = message.schedulerCount; return object; }; /** - * Converts this CheckUpgradeResponse to JSON. + * Converts this SoftwareConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @instance * @returns {Object.} JSON object */ - CheckUpgradeResponse.prototype.toJSON = function toJSON() { + SoftwareConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CheckUpgradeResponse + * Gets the default type url for SoftwareConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @memberof google.cloud.orchestration.airflow.service.v1.SoftwareConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CheckUpgradeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.SoftwareConfig"; }; - /** - * ConflictResult enum. - * @name google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult - * @enum {number} - * @property {number} CONFLICT_RESULT_UNSPECIFIED=0 CONFLICT_RESULT_UNSPECIFIED value - * @property {number} CONFLICT=1 CONFLICT value - * @property {number} NO_CONFLICT=2 NO_CONFLICT value - */ - CheckUpgradeResponse.ConflictResult = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONFLICT_RESULT_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONFLICT"] = 1; - values[valuesById[2] = "NO_CONFLICT"] = 2; - return values; - })(); - - return CheckUpgradeResponse; + return SoftwareConfig; })(); - v1.ImageVersions = (function() { + v1.IPAllocationPolicy = (function() { /** - * Constructs a new ImageVersions service. + * Properties of a IPAllocationPolicy. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an ImageVersions - * @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 + * @interface IIPAllocationPolicy + * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases + * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName + * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock + * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName + * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock */ - function ImageVersions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ImageVersions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageVersions; - - /** - * Creates new ImageVersions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions - * @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 {ImageVersions} RPC service. Useful where requests and/or responses are streamed. - */ - ImageVersions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions - * @typedef ListImageVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} [response] ListImageVersionsResponse + * Constructs a new IPAllocationPolicy. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a IPAllocationPolicy. + * @implements IIPAllocationPolicy + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set */ + function IPAllocationPolicy(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]]; + } /** - * Calls ListImageVersions. - * @function listImageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * IPAllocationPolicy useIpAliases. + * @member {boolean} useIpAliases + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback} callback Node-style callback called with the error, if any, and ListImageVersionsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ImageVersions.prototype.listImageVersions = function listImageVersions(request, callback) { - return this.rpcCall(listImageVersions, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, request, callback); - }, "name", { value: "ListImageVersions" }); + IPAllocationPolicy.prototype.useIpAliases = false; /** - * Calls ListImageVersions. - * @function listImageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * IPAllocationPolicy clusterSecondaryRangeName. + * @member {string|null|undefined} clusterSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ImageVersions; - })(); - - v1.ListImageVersionsRequest = (function() { - - /** - * Properties of a ListImageVersionsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IListImageVersionsRequest - * @property {string|null} [parent] ListImageVersionsRequest parent - * @property {number|null} [pageSize] ListImageVersionsRequest pageSize - * @property {string|null} [pageToken] ListImageVersionsRequest pageToken - * @property {boolean|null} [includePastReleases] ListImageVersionsRequest includePastReleases */ + IPAllocationPolicy.prototype.clusterSecondaryRangeName = null; /** - * Constructs a new ListImageVersionsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a ListImageVersionsRequest. - * @implements IListImageVersionsRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set + * IPAllocationPolicy clusterIpv4CidrBlock. + * @member {string|null|undefined} clusterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @instance */ - function ListImageVersionsRequest(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]]; - } + IPAllocationPolicy.prototype.clusterIpv4CidrBlock = null; /** - * ListImageVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * IPAllocationPolicy servicesSecondaryRangeName. + * @member {string|null|undefined} servicesSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance */ - ListImageVersionsRequest.prototype.parent = ""; + IPAllocationPolicy.prototype.servicesSecondaryRangeName = null; /** - * ListImageVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * IPAllocationPolicy servicesIpv4CidrBlock. + * @member {string|null|undefined} servicesIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance */ - ListImageVersionsRequest.prototype.pageSize = 0; + IPAllocationPolicy.prototype.servicesIpv4CidrBlock = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListImageVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * IPAllocationPolicy clusterIpAllocation. + * @member {"clusterSecondaryRangeName"|"clusterIpv4CidrBlock"|undefined} clusterIpAllocation + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance */ - ListImageVersionsRequest.prototype.pageToken = ""; + Object.defineProperty(IPAllocationPolicy.prototype, "clusterIpAllocation", { + get: $util.oneOfGetter($oneOfFields = ["clusterSecondaryRangeName", "clusterIpv4CidrBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * ListImageVersionsRequest includePastReleases. - * @member {boolean} includePastReleases - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * IPAllocationPolicy servicesIpAllocation. + * @member {"servicesSecondaryRangeName"|"servicesIpv4CidrBlock"|undefined} servicesIpAllocation + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance */ - ListImageVersionsRequest.prototype.includePastReleases = false; + Object.defineProperty(IPAllocationPolicy.prototype, "servicesIpAllocation", { + get: $util.oneOfGetter($oneOfFields = ["servicesSecondaryRangeName", "servicesIpv4CidrBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListImageVersionsRequest instance using the specified properties. + * Creates a new IPAllocationPolicy instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy instance */ - ListImageVersionsRequest.create = function create(properties) { - return new ListImageVersionsRequest(properties); + IPAllocationPolicy.create = function create(properties) { + return new IPAllocationPolicy(properties); }; /** - * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsRequest.encode = function encode(message, writer) { + IPAllocationPolicy.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.includePastReleases != null && Object.hasOwnProperty.call(message, "includePastReleases")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includePastReleases); + if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); + if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); + if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); + if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); + if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); return writer; }; /** - * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer. + * Decodes a IPAllocationPolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsRequest.decode = function decode(reader, length) { + IPAllocationPolicy.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.orchestration.airflow.service.v1.ListImageVersionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.useIpAliases = reader.bool(); break; } case 2: { - message.pageSize = reader.int32(); + message.clusterSecondaryRangeName = reader.string(); + break; + } + case 4: { + message.clusterIpv4CidrBlock = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.servicesSecondaryRangeName = reader.string(); break; } - case 4: { - message.includePastReleases = reader.bool(); + case 5: { + message.servicesIpv4CidrBlock = reader.string(); break; } default: @@ -5973,149 +5255,186 @@ }; /** - * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListImageVersionsRequest message. + * Verifies a IPAllocationPolicy message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListImageVersionsRequest.verify = function verify(message) { + IPAllocationPolicy.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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) - if (typeof message.includePastReleases !== "boolean") - return "includePastReleases: boolean expected"; - return null; - }; - - /** - * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest - */ - ListImageVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); - 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.includePastReleases != null) - message.includePastReleases = Boolean(object.includePastReleases); - return message; - }; - - /** - * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. + var properties = {}; + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + if (typeof message.useIpAliases !== "boolean") + return "useIpAliases: boolean expected"; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { + properties.clusterIpAllocation = 1; + if (!$util.isString(message.clusterSecondaryRangeName)) + return "clusterSecondaryRangeName: string expected"; + } + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { + if (properties.clusterIpAllocation === 1) + return "clusterIpAllocation: multiple values"; + properties.clusterIpAllocation = 1; + if (!$util.isString(message.clusterIpv4CidrBlock)) + return "clusterIpv4CidrBlock: string expected"; + } + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { + properties.servicesIpAllocation = 1; + if (!$util.isString(message.servicesSecondaryRangeName)) + return "servicesSecondaryRangeName: string expected"; + } + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { + if (properties.servicesIpAllocation === 1) + return "servicesIpAllocation: multiple values"; + properties.servicesIpAllocation = 1; + if (!$util.isString(message.servicesIpv4CidrBlock)) + return "servicesIpv4CidrBlock: string expected"; + } + return null; + }; + + /** + * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} IPAllocationPolicy + */ + IPAllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy(); + if (object.useIpAliases != null) + message.useIpAliases = Boolean(object.useIpAliases); + if (object.clusterSecondaryRangeName != null) + message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); + if (object.clusterIpv4CidrBlock != null) + message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); + if (object.servicesSecondaryRangeName != null) + message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); + if (object.servicesIpv4CidrBlock != null) + message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); + return message; + }; + + /** + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} message ListImageVersionsRequest + * @param {google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy} message IPAllocationPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListImageVersionsRequest.toObject = function toObject(message, options) { + IPAllocationPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.includePastReleases = false; + if (options.defaults) + object.useIpAliases = false; + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + object.useIpAliases = message.useIpAliases; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) { + object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; + if (options.oneofs) + object.clusterIpAllocation = "clusterSecondaryRangeName"; + } + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) { + object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; + if (options.oneofs) + object.servicesIpAllocation = "servicesSecondaryRangeName"; + } + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) { + object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; + if (options.oneofs) + object.clusterIpAllocation = "clusterIpv4CidrBlock"; + } + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) { + object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; + if (options.oneofs) + object.servicesIpAllocation = "servicesIpv4CidrBlock"; } - 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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) - object.includePastReleases = message.includePastReleases; return object; }; /** - * Converts this ListImageVersionsRequest to JSON. + * Converts this IPAllocationPolicy to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @instance * @returns {Object.} JSON object */ - ListImageVersionsRequest.prototype.toJSON = function toJSON() { + IPAllocationPolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListImageVersionsRequest + * Gets the default type url for IPAllocationPolicy * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest + * @memberof google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListImageVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy"; }; - return ListImageVersionsRequest; + return IPAllocationPolicy; })(); - v1.ListImageVersionsResponse = (function() { + v1.NodeConfig = (function() { /** - * Properties of a ListImageVersionsResponse. + * Properties of a NodeConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IListImageVersionsResponse - * @property {Array.|null} [imageVersions] ListImageVersionsResponse imageVersions - * @property {string|null} [nextPageToken] ListImageVersionsResponse nextPageToken + * @interface INodeConfig + * @property {string|null} [location] NodeConfig location + * @property {string|null} [machineType] NodeConfig machineType + * @property {string|null} [network] NodeConfig network + * @property {string|null} [subnetwork] NodeConfig subnetwork + * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb + * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes + * @property {string|null} [serviceAccount] NodeConfig serviceAccount + * @property {Array.|null} [tags] NodeConfig tags + * @property {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy + * @property {boolean|null} [enableIpMasqAgent] NodeConfig enableIpMasqAgent */ /** - * Constructs a new ListImageVersionsResponse. + * Constructs a new NodeConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents a ListImageVersionsResponse. - * @implements IListImageVersionsResponse + * @classdesc Represents a NodeConfig. + * @implements INodeConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set */ - function ListImageVersionsResponse(properties) { - this.imageVersions = []; + function NodeConfig(properties) { + this.oauthScopes = []; + this.tags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6123,92 +5442,207 @@ } /** - * ListImageVersionsResponse imageVersions. - * @member {Array.} imageVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * NodeConfig location. + * @member {string} location + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @instance */ - ListImageVersionsResponse.prototype.imageVersions = $util.emptyArray; + NodeConfig.prototype.location = ""; /** - * ListImageVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * NodeConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @instance */ - ListImageVersionsResponse.prototype.nextPageToken = ""; + NodeConfig.prototype.machineType = ""; /** - * Creates a new ListImageVersionsResponse instance using the specified properties. + * NodeConfig network. + * @member {string} network + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.network = ""; + + /** + * NodeConfig subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.subnetwork = ""; + + /** + * NodeConfig diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.diskSizeGb = 0; + + /** + * NodeConfig oauthScopes. + * @member {Array.} oauthScopes + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.oauthScopes = $util.emptyArray; + + /** + * NodeConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.serviceAccount = ""; + + /** + * NodeConfig tags. + * @member {Array.} tags + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.tags = $util.emptyArray; + + /** + * NodeConfig ipAllocationPolicy. + * @member {google.cloud.orchestration.airflow.service.v1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.ipAllocationPolicy = null; + + /** + * NodeConfig enableIpMasqAgent. + * @member {boolean} enableIpMasqAgent + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig + * @instance + */ + NodeConfig.prototype.enableIpMasqAgent = false; + + /** + * Creates a new NodeConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse instance + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig instance */ - ListImageVersionsResponse.create = function create(properties) { - return new ListImageVersionsResponse(properties); + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); }; /** - * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsResponse.encode = function encode(message, writer) { + NodeConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersions != null && message.imageVersions.length) - for (var i = 0; i < message.imageVersions.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.encode(message.imageVersions[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; - }; - - /** - * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); + if (message.oauthScopes != null && message.oauthScopes.length) + for (var i = 0; i < message.oauthScopes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) + $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableIpMasqAgent != null && Object.hasOwnProperty.call(message, "enableIpMasqAgent")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableIpMasqAgent); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.INodeConfig} message NodeConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListImageVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer. + * Decodes a NodeConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsResponse.decode = function decode(reader, length) { + NodeConfig.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.orchestration.airflow.service.v1.ListImageVersionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.imageVersions && message.imageVersions.length)) - message.imageVersions = []; - message.imageVersions.push($root.google.cloud.orchestration.airflow.service.v1.ImageVersion.decode(reader, reader.uint32())); + message.location = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.machineType = reader.string(); + break; + } + case 3: { + message.network = reader.string(); + break; + } + case 4: { + message.subnetwork = reader.string(); + break; + } + case 5: { + message.diskSizeGb = reader.int32(); + break; + } + case 6: { + if (!(message.oauthScopes && message.oauthScopes.length)) + message.oauthScopes = []; + message.oauthScopes.push(reader.string()); + break; + } + case 7: { + message.serviceAccount = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 9: { + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 11: { + message.enableIpMasqAgent = reader.bool(); break; } default: @@ -6220,154 +5654,228 @@ }; /** - * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListImageVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + NodeConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListImageVersionsResponse message. + * Verifies a NodeConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListImageVersionsResponse.verify = function verify(message) { + NodeConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersions != null && message.hasOwnProperty("imageVersions")) { - if (!Array.isArray(message.imageVersions)) - return "imageVersions: array expected"; - for (var i = 0; i < message.imageVersions.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.verify(message.imageVersions[i]); - if (error) - return "imageVersions." + error; - } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { + if (!Array.isArray(message.oauthScopes)) + return "oauthScopes: array expected"; + for (var i = 0; i < message.oauthScopes.length; ++i) + if (!$util.isString(message.oauthScopes[i])) + return "oauthScopes: string[] expected"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.verify(message.ipAllocationPolicy); + if (error) + return "ipAllocationPolicy." + error; + } + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + if (typeof message.enableIpMasqAgent !== "boolean") + return "enableIpMasqAgent: boolean expected"; return null; }; /** - * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse + * @returns {google.cloud.orchestration.airflow.service.v1.NodeConfig} NodeConfig */ - ListImageVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NodeConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); - if (object.imageVersions) { - if (!Array.isArray(object.imageVersions)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: array expected"); - message.imageVersions = []; - for (var i = 0; i < object.imageVersions.length; ++i) { - if (typeof object.imageVersions[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: object expected"); - message.imageVersions[i] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.fromObject(object.imageVersions[i]); - } + var message = new $root.google.cloud.orchestration.airflow.service.v1.NodeConfig(); + if (object.location != null) + message.location = String(object.location); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.oauthScopes) { + if (!Array.isArray(object.oauthScopes)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.oauthScopes: array expected"); + message.oauthScopes = []; + for (var i = 0; i < object.oauthScopes.length; ++i) + message.oauthScopes[i] = String(object.oauthScopes[i]); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.ipAllocationPolicy != null) { + if (typeof object.ipAllocationPolicy !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.NodeConfig.ipAllocationPolicy: object expected"); + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); + } + if (object.enableIpMasqAgent != null) + message.enableIpMasqAgent = Boolean(object.enableIpMasqAgent); return message; }; /** - * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} message ListImageVersionsResponse + * @param {google.cloud.orchestration.airflow.service.v1.NodeConfig} message NodeConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListImageVersionsResponse.toObject = function toObject(message, options) { + NodeConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.imageVersions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.imageVersions && message.imageVersions.length) { - object.imageVersions = []; - for (var j = 0; j < message.imageVersions.length; ++j) - object.imageVersions[j] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.toObject(message.imageVersions[j], options); + if (options.arrays || options.defaults) { + object.oauthScopes = []; + object.tags = []; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (options.defaults) { + object.location = ""; + object.machineType = ""; + object.network = ""; + object.subnetwork = ""; + object.diskSizeGb = 0; + object.serviceAccount = ""; + object.ipAllocationPolicy = null; + object.enableIpMasqAgent = false; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.oauthScopes && message.oauthScopes.length) { + object.oauthScopes = []; + for (var j = 0; j < message.oauthScopes.length; ++j) + object.oauthScopes[j] = message.oauthScopes[j]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) + object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + object.enableIpMasqAgent = message.enableIpMasqAgent; return object; }; /** - * Converts this ListImageVersionsResponse to JSON. + * Converts this NodeConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @instance * @returns {Object.} JSON object */ - ListImageVersionsResponse.prototype.toJSON = function toJSON() { + NodeConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListImageVersionsResponse + * Gets the default type url for NodeConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse + * @memberof google.cloud.orchestration.airflow.service.v1.NodeConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListImageVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NodeConfig"; }; - return ListImageVersionsResponse; + return NodeConfig; })(); - v1.ImageVersion = (function() { + v1.PrivateClusterConfig = (function() { /** - * Properties of an ImageVersion. + * Properties of a PrivateClusterConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IImageVersion - * @property {string|null} [imageVersionId] ImageVersion imageVersionId - * @property {boolean|null} [isDefault] ImageVersion isDefault - * @property {Array.|null} [supportedPythonVersions] ImageVersion supportedPythonVersions - * @property {google.type.IDate|null} [releaseDate] ImageVersion releaseDate - * @property {boolean|null} [creationDisabled] ImageVersion creationDisabled - * @property {boolean|null} [upgradeDisabled] ImageVersion upgradeDisabled + * @interface IPrivateClusterConfig + * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint + * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock + * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange */ /** - * Constructs a new ImageVersion. + * Constructs a new PrivateClusterConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an ImageVersion. - * @implements IImageVersion + * @classdesc Represents a PrivateClusterConfig. + * @implements IPrivateClusterConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set */ - function ImageVersion(properties) { - this.supportedPythonVersions = []; + function PrivateClusterConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6375,148 +5883,103 @@ } /** - * ImageVersion imageVersionId. - * @member {string} imageVersionId - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.imageVersionId = ""; - - /** - * ImageVersion isDefault. - * @member {boolean} isDefault - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.isDefault = false; - - /** - * ImageVersion supportedPythonVersions. - * @member {Array.} supportedPythonVersions - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion - * @instance - */ - ImageVersion.prototype.supportedPythonVersions = $util.emptyArray; - - /** - * ImageVersion releaseDate. - * @member {google.type.IDate|null|undefined} releaseDate - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * PrivateClusterConfig enablePrivateEndpoint. + * @member {boolean} enablePrivateEndpoint + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @instance */ - ImageVersion.prototype.releaseDate = null; + PrivateClusterConfig.prototype.enablePrivateEndpoint = false; /** - * ImageVersion creationDisabled. - * @member {boolean} creationDisabled - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * PrivateClusterConfig masterIpv4CidrBlock. + * @member {string} masterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @instance */ - ImageVersion.prototype.creationDisabled = false; + PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; /** - * ImageVersion upgradeDisabled. - * @member {boolean} upgradeDisabled - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * PrivateClusterConfig masterIpv4ReservedRange. + * @member {string} masterIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @instance */ - ImageVersion.prototype.upgradeDisabled = false; + PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; /** - * Creates a new ImageVersion instance using the specified properties. + * Creates a new PrivateClusterConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion instance + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig instance */ - ImageVersion.create = function create(properties) { - return new ImageVersion(properties); + PrivateClusterConfig.create = function create(properties) { + return new PrivateClusterConfig(properties); }; /** - * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageVersion.encode = function encode(message, writer) { + PrivateClusterConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersionId != null && Object.hasOwnProperty.call(message, "imageVersionId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersionId); - if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isDefault); - if (message.supportedPythonVersions != null && message.supportedPythonVersions.length) - for (var i = 0; i < message.supportedPythonVersions.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.supportedPythonVersions[i]); - if (message.releaseDate != null && Object.hasOwnProperty.call(message, "releaseDate")) - $root.google.type.Date.encode(message.releaseDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.creationDisabled != null && Object.hasOwnProperty.call(message, "creationDisabled")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.creationDisabled); - if (message.upgradeDisabled != null && Object.hasOwnProperty.call(message, "upgradeDisabled")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.upgradeDisabled); + if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); + if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); + if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); return writer; }; /** - * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageVersion.encodeDelimited = function encodeDelimited(message, writer) { + PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImageVersion message from the specified reader or buffer. + * Decodes a PrivateClusterConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageVersion.decode = function decode(reader, length) { + PrivateClusterConfig.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.orchestration.airflow.service.v1.ImageVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.imageVersionId = reader.string(); + message.enablePrivateEndpoint = reader.bool(); break; } case 2: { - message.isDefault = reader.bool(); + message.masterIpv4CidrBlock = reader.string(); break; } case 3: { - if (!(message.supportedPythonVersions && message.supportedPythonVersions.length)) - message.supportedPythonVersions = []; - message.supportedPythonVersions.push(reader.string()); - break; - } - case 4: { - message.releaseDate = $root.google.type.Date.decode(reader, reader.uint32()); - break; - } - case 5: { - message.creationDisabled = reader.bool(); - break; - } - case 6: { - message.upgradeDisabled = reader.bool(); + message.masterIpv4ReservedRange = reader.string(); break; } default: @@ -6528,186 +5991,139 @@ }; /** - * Decodes an ImageVersion message from the specified reader or buffer, length delimited. + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageVersion.decodeDelimited = function decodeDelimited(reader) { + PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImageVersion message. + * Verifies a PrivateClusterConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImageVersion.verify = function verify(message) { + PrivateClusterConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) - if (!$util.isString(message.imageVersionId)) - return "imageVersionId: string expected"; - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - if (typeof message.isDefault !== "boolean") - return "isDefault: boolean expected"; - if (message.supportedPythonVersions != null && message.hasOwnProperty("supportedPythonVersions")) { - if (!Array.isArray(message.supportedPythonVersions)) - return "supportedPythonVersions: array expected"; - for (var i = 0; i < message.supportedPythonVersions.length; ++i) - if (!$util.isString(message.supportedPythonVersions[i])) - return "supportedPythonVersions: string[] expected"; - } - if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) { - var error = $root.google.type.Date.verify(message.releaseDate); - if (error) - return "releaseDate." + error; - } - if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) - if (typeof message.creationDisabled !== "boolean") - return "creationDisabled: boolean expected"; - if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) - if (typeof message.upgradeDisabled !== "boolean") - return "upgradeDisabled: boolean expected"; + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + if (typeof message.enablePrivateEndpoint !== "boolean") + return "enablePrivateEndpoint: boolean expected"; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + if (!$util.isString(message.masterIpv4CidrBlock)) + return "masterIpv4CidrBlock: string expected"; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + if (!$util.isString(message.masterIpv4ReservedRange)) + return "masterIpv4ReservedRange: string expected"; return null; }; /** - * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} PrivateClusterConfig */ - ImageVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ImageVersion) + PrivateClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); - if (object.imageVersionId != null) - message.imageVersionId = String(object.imageVersionId); - if (object.isDefault != null) - message.isDefault = Boolean(object.isDefault); - if (object.supportedPythonVersions) { - if (!Array.isArray(object.supportedPythonVersions)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.supportedPythonVersions: array expected"); - message.supportedPythonVersions = []; - for (var i = 0; i < object.supportedPythonVersions.length; ++i) - message.supportedPythonVersions[i] = String(object.supportedPythonVersions[i]); - } - if (object.releaseDate != null) { - if (typeof object.releaseDate !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.releaseDate: object expected"); - message.releaseDate = $root.google.type.Date.fromObject(object.releaseDate); - } - if (object.creationDisabled != null) - message.creationDisabled = Boolean(object.creationDisabled); - if (object.upgradeDisabled != null) - message.upgradeDisabled = Boolean(object.upgradeDisabled); + var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig(); + if (object.enablePrivateEndpoint != null) + message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); + if (object.masterIpv4CidrBlock != null) + message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); + if (object.masterIpv4ReservedRange != null) + message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); return message; }; /** - * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.ImageVersion} message ImageVersion + * @param {google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig} message PrivateClusterConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImageVersion.toObject = function toObject(message, options) { + PrivateClusterConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedPythonVersions = []; if (options.defaults) { - object.imageVersionId = ""; - object.isDefault = false; - object.releaseDate = null; - object.creationDisabled = false; - object.upgradeDisabled = false; - } - if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) - object.imageVersionId = message.imageVersionId; - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - object.isDefault = message.isDefault; - if (message.supportedPythonVersions && message.supportedPythonVersions.length) { - object.supportedPythonVersions = []; - for (var j = 0; j < message.supportedPythonVersions.length; ++j) - object.supportedPythonVersions[j] = message.supportedPythonVersions[j]; + object.enablePrivateEndpoint = false; + object.masterIpv4CidrBlock = ""; + object.masterIpv4ReservedRange = ""; } - if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) - object.releaseDate = $root.google.type.Date.toObject(message.releaseDate, options); - if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) - object.creationDisabled = message.creationDisabled; - if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) - object.upgradeDisabled = message.upgradeDisabled; + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + object.enablePrivateEndpoint = message.enablePrivateEndpoint; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; return object; }; /** - * Converts this ImageVersion to JSON. + * Converts this PrivateClusterConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @instance * @returns {Object.} JSON object */ - ImageVersion.prototype.toJSON = function toJSON() { + PrivateClusterConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImageVersion + * Gets the default type url for PrivateClusterConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImageVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ImageVersion"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig"; }; - return ImageVersion; + return PrivateClusterConfig; })(); - v1.OperationMetadata = (function() { + v1.NetworkingConfig = (function() { /** - * Properties of an OperationMetadata. + * Properties of a NetworkingConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @interface IOperationMetadata - * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null} [state] OperationMetadata state - * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null} [operationType] OperationMetadata operationType - * @property {string|null} [resource] OperationMetadata resource - * @property {string|null} [resourceUuid] OperationMetadata resourceUuid - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @interface INetworkingConfig + * @property {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType|null} [connectionType] NetworkingConfig connectionType */ /** - * Constructs a new OperationMetadata. + * Constructs a new NetworkingConfig. * @memberof google.cloud.orchestration.airflow.service.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a NetworkingConfig. + * @implements INetworkingConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set */ - function OperationMetadata(properties) { + function NetworkingConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6715,145 +6131,75 @@ } /** - * OperationMetadata state. - * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State} state - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.state = 0; - - /** - * OperationMetadata operationType. - * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type} operationType - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.operationType = 0; - - /** - * OperationMetadata resource. - * @member {string} resource - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.resource = ""; - - /** - * OperationMetadata resourceUuid. - * @member {string} resourceUuid - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.resourceUuid = ""; - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * NetworkingConfig connectionType. + * @member {google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType} connectionType + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @instance */ - OperationMetadata.prototype.endTime = null; + NetworkingConfig.prototype.connectionType = 0; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new NetworkingConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + NetworkingConfig.create = function create(properties) { + return new NetworkingConfig(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + NetworkingConfig.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.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operationType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); - if (message.resourceUuid != null && Object.hasOwnProperty.call(message, "resourceUuid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUuid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.connectionType); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.INetworkingConfig} message NetworkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + NetworkingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a NetworkingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decode = function decode(reader, length) { + NetworkingConfig.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.orchestration.airflow.service.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.operationType = reader.int32(); - break; - } - case 3: { - message.resource = reader.string(); - break; - } - case 4: { - message.resourceUuid = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.connectionType = reader.int32(); break; } default: @@ -6865,657 +6211,373 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + NetworkingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a NetworkingConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OperationMetadata.verify = function verify(message) { + NetworkingConfig.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 3: - case 4: - break; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + switch (message.connectionType) { default: - return "operationType: enum value expected"; + return "connectionType: enum value expected"; case 0: case 1: case 2: - case 3: - case 4: break; } - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) - if (!$util.isString(message.resourceUuid)) - return "resourceUuid: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + 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 an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} NetworkingConfig */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata) + NetworkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "SUCCESSFUL": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - } - switch (object.operationType) { + var message = new $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig(); + switch (object.connectionType) { default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; + if (typeof object.connectionType === "number") { + message.connectionType = object.connectionType; break; } break; - case "TYPE_UNSPECIFIED": + case "CONNECTION_TYPE_UNSPECIFIED": case 0: - message.operationType = 0; + message.connectionType = 0; break; - case "CREATE": + case "VPC_PEERING": case 1: - message.operationType = 1; + message.connectionType = 1; break; - case "DELETE": + case "PRIVATE_SERVICE_CONNECT": case 2: - message.operationType = 2; - break; - case "UPDATE": - case 3: - message.operationType = 3; - break; - case "CHECK": - case 4: - message.operationType = 4; + message.connectionType = 2; break; } - if (object.resource != null) - message.resource = String(object.resource); - if (object.resourceUuid != null) - message.resourceUuid = String(object.resourceUuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.orchestration.airflow.service.v1.NetworkingConfig} message NetworkingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + NetworkingConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.operationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.resource = ""; - object.resourceUuid = ""; - object.createTime = null; - object.endTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] : message.state; - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] === undefined ? message.operationType : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] : message.operationType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) - object.resourceUuid = message.resourceUuid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (options.defaults) + object.connectionType = options.enums === String ? "CONNECTION_TYPE_UNSPECIFIED" : 0; + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + object.connectionType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType[message.connectionType] : message.connectionType; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this NetworkingConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + NetworkingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for NetworkingConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @memberof google.cloud.orchestration.airflow.service.v1.NetworkingConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + NetworkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.NetworkingConfig"; }; /** - * State enum. - * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} SUCCESSFUL=3 SUCCESSFUL value - * @property {number} FAILED=4 FAILED value - */ - OperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values["SUCCESSFUL"] = 3; - values[valuesById[4] = "FAILED"] = 4; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type + * ConnectionType enum. + * @name google.cloud.orchestration.airflow.service.v1.NetworkingConfig.ConnectionType * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} CREATE=1 CREATE value - * @property {number} DELETE=2 DELETE value - * @property {number} UPDATE=3 UPDATE value - * @property {number} CHECK=4 CHECK value + * @property {number} CONNECTION_TYPE_UNSPECIFIED=0 CONNECTION_TYPE_UNSPECIFIED value + * @property {number} VPC_PEERING=1 VPC_PEERING value + * @property {number} PRIVATE_SERVICE_CONNECT=2 PRIVATE_SERVICE_CONNECT value */ - OperationMetadata.Type = (function() { + NetworkingConfig.ConnectionType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATE"] = 1; - values[valuesById[2] = "DELETE"] = 2; - values[valuesById[3] = "UPDATE"] = 3; - values[valuesById[4] = "CHECK"] = 4; + values[valuesById[0] = "CONNECTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VPC_PEERING"] = 1; + values[valuesById[2] = "PRIVATE_SERVICE_CONNECT"] = 2; return values; })(); - return OperationMetadata; + return NetworkingConfig; })(); - return v1; - })(); - - service.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof google.cloud.orchestration.airflow.service - * @namespace - */ - var v1beta1 = {}; + v1.PrivateEnvironmentConfig = (function() { - v1beta1.Environments = (function() { + /** + * Properties of a PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IPrivateEnvironmentConfig + * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment + * @property {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig + * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock + * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock + * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange + * @property {string|null} [cloudComposerNetworkIpv4CidrBlock] PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock + * @property {string|null} [cloudComposerNetworkIpv4ReservedRange] PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange + * @property {boolean|null} [enablePrivatelyUsedPublicIps] PrivateEnvironmentConfig enablePrivatelyUsedPublicIps + * @property {string|null} [cloudComposerConnectionSubnetwork] PrivateEnvironmentConfig cloudComposerConnectionSubnetwork + * @property {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null} [networkingConfig] PrivateEnvironmentConfig networkingConfig + */ /** - * Constructs a new Environments service. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an Environments - * @extends $protobuf.rpc.Service + * Constructs a new PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a PrivateEnvironmentConfig. + * @implements IPrivateEnvironmentConfig * @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 + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set */ - function Environments(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function PrivateEnvironmentConfig(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]]; } - (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; - /** - * Creates new Environments service using the specified rpc implementation. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @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 {Environments} RPC service. Useful where requests and/or responses are streamed. + * PrivateEnvironmentConfig enablePrivateEnvironment. + * @member {boolean} enablePrivateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance */ - Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef CreateEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * PrivateEnvironmentConfig privateClusterConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IPrivateClusterConfig|null|undefined} privateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance */ + PrivateEnvironmentConfig.prototype.privateClusterConfig = null; /** - * Calls CreateEnvironment. - * @function createEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig webServerIpv4CidrBlock. + * @member {string} webServerIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { - return this.rpcCall(createEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateEnvironment" }); + PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; /** - * Calls CreateEnvironment. - * @function createEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. + * @member {string} cloudSqlIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef GetEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} [response] Environment + * PrivateEnvironmentConfig webServerIpv4ReservedRange. + * @member {string} webServerIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance */ + PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; /** - * Calls GetEnvironment. - * @function getEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. + * @member {string} cloudComposerNetworkIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { - return this.rpcCall(getEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.Environment, request, callback); - }, "name", { value: "GetEnvironment" }); + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4CidrBlock = ""; /** - * Calls GetEnvironment. - * @function getEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. + * @member {string} cloudComposerNetworkIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4ReservedRange = ""; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef ListEnvironmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + * PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. + * @member {boolean} enablePrivatelyUsedPublicIps + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @instance */ + PrivateEnvironmentConfig.prototype.enablePrivatelyUsedPublicIps = false; /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. + * @member {string} cloudComposerConnectionSubnetwork + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { - return this.rpcCall(listEnvironments, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, request, callback); - }, "name", { value: "ListEnvironments" }); + PrivateEnvironmentConfig.prototype.cloudComposerConnectionSubnetwork = ""; /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * PrivateEnvironmentConfig networkingConfig. + * @member {google.cloud.orchestration.airflow.service.v1.INetworkingConfig|null|undefined} networkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + PrivateEnvironmentConfig.prototype.networkingConfig = null; /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef UpdateEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance */ + PrivateEnvironmentConfig.create = function create(properties) { + return new PrivateEnvironmentConfig(properties); + }; /** - * Calls UpdateEnvironment. - * @function updateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { - return this.rpcCall(updateEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateEnvironment" }); - - /** - * Calls UpdateEnvironment. - * @function updateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef DeleteEnvironmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteEnvironment. - * @function deleteEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { - return this.rpcCall(deleteEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteEnvironment" }); - - /** - * Calls DeleteEnvironment. - * @function deleteEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef RestartWebServerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestartWebServer. - * @function restartWebServer - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.restartWebServer = function restartWebServer(request, callback) { - return this.rpcCall(restartWebServer, $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestartWebServer" }); - - /** - * Calls RestartWebServer. - * @function restartWebServer - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @typedef CheckUpgradeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CheckUpgrade. - * @function checkUpgrade - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object - * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.checkUpgrade = function checkUpgrade(request, callback) { - return this.rpcCall(checkUpgrade, $root.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CheckUpgrade" }); - - /** - * Calls CheckUpgrade. - * @function checkUpgrade - * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments - * @instance - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Environments; - })(); - - v1beta1.CreateEnvironmentRequest = (function() { - - /** - * Properties of a CreateEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ICreateEnvironmentRequest - * @property {string|null} [parent] CreateEnvironmentRequest parent - * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] CreateEnvironmentRequest environment - */ - - /** - * Constructs a new CreateEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a CreateEnvironmentRequest. - * @implements ICreateEnvironmentRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set - */ - function CreateEnvironmentRequest(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]]; - } - - /** - * CreateEnvironmentRequest parent. - * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest - * @instance - */ - CreateEnvironmentRequest.prototype.parent = ""; - - /** - * CreateEnvironmentRequest environment. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest - * @instance - */ - CreateEnvironmentRequest.prototype.environment = null; - - /** - * Creates a new CreateEnvironmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest instance - */ - CreateEnvironmentRequest.create = function create(properties) { - return new CreateEnvironmentRequest(properties); - }; - - /** - * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEnvironmentRequest.encode = function encode(message, writer) { + PrivateEnvironmentConfig.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.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); + if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) + $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); + if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); + if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); + if (message.enablePrivatelyUsedPublicIps != null && Object.hasOwnProperty.call(message, "enablePrivatelyUsedPublicIps")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enablePrivatelyUsedPublicIps); + if (message.cloudComposerNetworkIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4CidrBlock")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudComposerNetworkIpv4CidrBlock); + if (message.cloudComposerNetworkIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4ReservedRange")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudComposerNetworkIpv4ReservedRange); + if (message.cloudComposerConnectionSubnetwork != null && Object.hasOwnProperty.call(message, "cloudComposerConnectionSubnetwork")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cloudComposerConnectionSubnetwork); + if (message.networkingConfig != null && Object.hasOwnProperty.call(message, "networkingConfig")) + $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.encode(message.networkingConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEnvironmentRequest.decode = function decode(reader, length) { + PrivateEnvironmentConfig.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.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.enablePrivateEnvironment = reader.bool(); break; } case 2: { - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.webServerIpv4CidrBlock = reader.string(); + break; + } + case 4: { + message.cloudSqlIpv4CidrBlock = reader.string(); + break; + } + case 5: { + message.webServerIpv4ReservedRange = reader.string(); + break; + } + case 7: { + message.cloudComposerNetworkIpv4CidrBlock = reader.string(); + break; + } + case 8: { + message.cloudComposerNetworkIpv4ReservedRange = reader.string(); + break; + } + case 6: { + message.enablePrivatelyUsedPublicIps = reader.bool(); + break; + } + case 9: { + message.cloudComposerConnectionSubnetwork = reader.string(); + break; + } + case 10: { + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.decode(reader, reader.uint32()); break; } default: @@ -7527,136 +6589,207 @@ }; /** - * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateEnvironmentRequest message. + * Verifies a PrivateEnvironmentConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateEnvironmentRequest.verify = function verify(message) { + PrivateEnvironmentConfig.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.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + if (typeof message.enablePrivateEnvironment !== "boolean") + return "enablePrivateEnvironment: boolean expected"; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.verify(message.privateClusterConfig); if (error) - return "environment." + error; + return "privateClusterConfig." + error; + } + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + if (!$util.isString(message.webServerIpv4CidrBlock)) + return "webServerIpv4CidrBlock: string expected"; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + if (!$util.isString(message.cloudSqlIpv4CidrBlock)) + return "cloudSqlIpv4CidrBlock: string expected"; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + if (!$util.isString(message.webServerIpv4ReservedRange)) + return "webServerIpv4ReservedRange: string expected"; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + if (!$util.isString(message.cloudComposerNetworkIpv4CidrBlock)) + return "cloudComposerNetworkIpv4CidrBlock: string expected"; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + if (!$util.isString(message.cloudComposerNetworkIpv4ReservedRange)) + return "cloudComposerNetworkIpv4ReservedRange: string expected"; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + if (typeof message.enablePrivatelyUsedPublicIps !== "boolean") + return "enablePrivatelyUsedPublicIps: boolean expected"; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + if (!$util.isString(message.cloudComposerConnectionSubnetwork)) + return "cloudComposerConnectionSubnetwork: string expected"; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.verify(message.networkingConfig); + if (error) + return "networkingConfig." + error; } return null; }; /** - * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} PrivateEnvironmentConfig */ - CreateEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest) + PrivateEnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.environment: object expected"); - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); + var message = new $root.google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig(); + if (object.enablePrivateEnvironment != null) + message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); + if (object.privateClusterConfig != null) { + if (typeof object.privateClusterConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.fromObject(object.privateClusterConfig); + } + if (object.webServerIpv4CidrBlock != null) + message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); + if (object.cloudSqlIpv4CidrBlock != null) + message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); + if (object.webServerIpv4ReservedRange != null) + message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); + if (object.cloudComposerNetworkIpv4CidrBlock != null) + message.cloudComposerNetworkIpv4CidrBlock = String(object.cloudComposerNetworkIpv4CidrBlock); + if (object.cloudComposerNetworkIpv4ReservedRange != null) + message.cloudComposerNetworkIpv4ReservedRange = String(object.cloudComposerNetworkIpv4ReservedRange); + if (object.enablePrivatelyUsedPublicIps != null) + message.enablePrivatelyUsedPublicIps = Boolean(object.enablePrivatelyUsedPublicIps); + if (object.cloudComposerConnectionSubnetwork != null) + message.cloudComposerConnectionSubnetwork = String(object.cloudComposerConnectionSubnetwork); + if (object.networkingConfig != null) { + if (typeof object.networkingConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig.networkingConfig: object expected"); + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.fromObject(object.networkingConfig); } return message; }; /** - * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} message CreateEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateEnvironmentRequest.toObject = function toObject(message, options) { + PrivateEnvironmentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.environment = null; + object.enablePrivateEnvironment = false; + object.privateClusterConfig = null; + object.webServerIpv4CidrBlock = ""; + object.cloudSqlIpv4CidrBlock = ""; + object.webServerIpv4ReservedRange = ""; + object.enablePrivatelyUsedPublicIps = false; + object.cloudComposerNetworkIpv4CidrBlock = ""; + object.cloudComposerNetworkIpv4ReservedRange = ""; + object.cloudComposerConnectionSubnetwork = ""; + object.networkingConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + object.enablePrivateEnvironment = message.enablePrivateEnvironment; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) + object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + object.enablePrivatelyUsedPublicIps = message.enablePrivatelyUsedPublicIps; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + object.cloudComposerNetworkIpv4CidrBlock = message.cloudComposerNetworkIpv4CidrBlock; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + object.cloudComposerNetworkIpv4ReservedRange = message.cloudComposerNetworkIpv4ReservedRange; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + object.cloudComposerConnectionSubnetwork = message.cloudComposerConnectionSubnetwork; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) + object.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1.NetworkingConfig.toObject(message.networkingConfig, options); return object; }; /** - * Converts this CreateEnvironmentRequest to JSON. + * Converts this PrivateEnvironmentConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @instance * @returns {Object.} JSON object */ - CreateEnvironmentRequest.prototype.toJSON = function toJSON() { + PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateEnvironmentRequest + * Gets the default type url for PrivateEnvironmentConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.PrivateEnvironmentConfig"; }; - return CreateEnvironmentRequest; + return PrivateEnvironmentConfig; })(); - v1beta1.GetEnvironmentRequest = (function() { + v1.WorkloadsConfig = (function() { /** - * Properties of a GetEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IGetEnvironmentRequest - * @property {string|null} [name] GetEnvironmentRequest name + * Properties of a WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IWorkloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null} [scheduler] WorkloadsConfig scheduler + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null} [webServer] WorkloadsConfig webServer + * @property {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null} [worker] WorkloadsConfig worker */ /** - * Constructs a new GetEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a GetEnvironmentRequest. - * @implements IGetEnvironmentRequest + * Constructs a new WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a WorkloadsConfig. + * @implements IWorkloadsConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set */ - function GetEnvironmentRequest(properties) { + function WorkloadsConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7664,75 +6797,103 @@ } /** - * GetEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * WorkloadsConfig scheduler. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource|null|undefined} scheduler + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @instance */ - GetEnvironmentRequest.prototype.name = ""; + WorkloadsConfig.prototype.scheduler = null; /** - * Creates a new GetEnvironmentRequest instance using the specified properties. + * WorkloadsConfig webServer. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource|null|undefined} webServer + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.webServer = null; + + /** + * WorkloadsConfig worker. + * @member {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource|null|undefined} worker + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.worker = null; + + /** + * Creates a new WorkloadsConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig instance */ - GetEnvironmentRequest.create = function create(properties) { - return new GetEnvironmentRequest(properties); + WorkloadsConfig.create = function create(properties) { + return new WorkloadsConfig(properties); }; /** - * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEnvironmentRequest.encode = function encode(message, writer) { + WorkloadsConfig.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.scheduler != null && Object.hasOwnProperty.call(message, "scheduler")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.encode(message.scheduler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.webServer != null && Object.hasOwnProperty.call(message, "webServer")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.encode(message.webServer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.worker != null && Object.hasOwnProperty.call(message, "worker")) + $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.encode(message.worker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + WorkloadsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer. + * Decodes a WorkloadsConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEnvironmentRequest.decode = function decode(reader, length) { + WorkloadsConfig.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.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.decode(reader, reader.uint32()); break; } default: @@ -7744,825 +6905,1184 @@ }; /** - * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + WorkloadsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetEnvironmentRequest message. + * Verifies a WorkloadsConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetEnvironmentRequest.verify = function verify(message) { + WorkloadsConfig.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.scheduler != null && message.hasOwnProperty("scheduler")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify(message.scheduler); + if (error) + return "scheduler." + error; + } + if (message.webServer != null && message.hasOwnProperty("webServer")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify(message.webServer); + if (error) + return "webServer." + error; + } + if (message.worker != null && message.hasOwnProperty("worker")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify(message.worker); + if (error) + return "worker." + error; + } return null; }; /** - * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} WorkloadsConfig */ - GetEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest) + WorkloadsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig(); + if (object.scheduler != null) { + if (typeof object.scheduler !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.scheduler: object expected"); + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.fromObject(object.scheduler); + } + if (object.webServer != null) { + if (typeof object.webServer !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.webServer: object expected"); + message.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.fromObject(object.webServer); + } + if (object.worker != null) { + if (typeof object.worker !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.worker: object expected"); + message.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.fromObject(object.worker); + } return message; }; /** - * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} message GetEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig} message WorkloadsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetEnvironmentRequest.toObject = function toObject(message, options) { + WorkloadsConfig.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 GetEnvironmentRequest to JSON. + if (options.defaults) { + object.scheduler = null; + object.webServer = null; + object.worker = null; + } + if (message.scheduler != null && message.hasOwnProperty("scheduler")) + object.scheduler = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.toObject(message.scheduler, options); + if (message.webServer != null && message.hasOwnProperty("webServer")) + object.webServer = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.toObject(message.webServer, options); + if (message.worker != null && message.hasOwnProperty("worker")) + object.worker = $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.toObject(message.worker, options); + return object; + }; + + /** + * Converts this WorkloadsConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @instance * @returns {Object.} JSON object */ - GetEnvironmentRequest.prototype.toJSON = function toJSON() { + WorkloadsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetEnvironmentRequest + * Gets the default type url for WorkloadsConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WorkloadsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig"; }; - return GetEnvironmentRequest; - })(); + WorkloadsConfig.SchedulerResource = (function() { - v1beta1.ListEnvironmentsRequest = (function() { + /** + * Properties of a SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface ISchedulerResource + * @property {number|null} [cpu] SchedulerResource cpu + * @property {number|null} [memoryGb] SchedulerResource memoryGb + * @property {number|null} [storageGb] SchedulerResource storageGb + * @property {number|null} [count] SchedulerResource count + */ - /** - * Properties of a ListEnvironmentsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IListEnvironmentsRequest - * @property {string|null} [parent] ListEnvironmentsRequest parent - * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize - * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken - */ + /** + * Constructs a new SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a SchedulerResource. + * @implements ISchedulerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + */ + function SchedulerResource(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]]; + } - /** - * Constructs a new ListEnvironmentsRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a ListEnvironmentsRequest. - * @implements IListEnvironmentsRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set - */ - function ListEnvironmentsRequest(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]]; - } + /** + * SchedulerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.cpu = 0; - /** - * ListEnvironmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @instance - */ - ListEnvironmentsRequest.prototype.parent = ""; + /** + * SchedulerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.memoryGb = 0; - /** - * ListEnvironmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @instance - */ - ListEnvironmentsRequest.prototype.pageSize = 0; + /** + * SchedulerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.storageGb = 0; - /** - * ListEnvironmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @instance - */ - ListEnvironmentsRequest.prototype.pageToken = ""; + /** + * SchedulerResource count. + * @member {number} count + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.count = 0; - /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance - */ - ListEnvironmentsRequest.create = function create(properties) { - return new ListEnvironmentsRequest(properties); - }; + /** + * Creates a new SchedulerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource instance + */ + SchedulerResource.create = function create(properties) { + return new SchedulerResource(properties); + }; - /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEnvironmentsRequest.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); - return writer; - }; + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); + return writer; + }; - /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEnvironmentsRequest.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.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); - 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(); + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.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.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListEnvironmentsRequest message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEnvironmentsRequest.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"; - return null; - }; + /** + * Verifies a SchedulerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; - /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest - */ - ListEnvironmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest) + /** + * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} SchedulerResource + */ + SchedulerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource} message SchedulerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.count = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); - 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); - return message; - }; + }; - /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEnvironmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - 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; - return object; - }; + /** + * Converts this SchedulerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @instance + * @returns {Object.} JSON object + */ + SchedulerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListEnvironmentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEnvironmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for SchedulerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.SchedulerResource"; + }; - /** - * Gets the default type url for ListEnvironmentsRequest - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest"; - }; + return SchedulerResource; + })(); - return ListEnvironmentsRequest; - })(); + WorkloadsConfig.WebServerResource = (function() { - v1beta1.ListEnvironmentsResponse = (function() { + /** + * Properties of a WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface IWebServerResource + * @property {number|null} [cpu] WebServerResource cpu + * @property {number|null} [memoryGb] WebServerResource memoryGb + * @property {number|null} [storageGb] WebServerResource storageGb + */ - /** - * Properties of a ListEnvironmentsResponse. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IListEnvironmentsResponse - * @property {Array.|null} [environments] ListEnvironmentsResponse environments - * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken - */ + /** + * Constructs a new WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a WebServerResource. + * @implements IWebServerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + */ + function WebServerResource(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]]; + } - /** - * Constructs a new ListEnvironmentsResponse. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a ListEnvironmentsResponse. - * @implements IListEnvironmentsResponse - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set - */ - function ListEnvironmentsResponse(properties) { - this.environments = []; - 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]]; - } + /** + * WebServerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.cpu = 0; - /** - * ListEnvironmentsResponse environments. - * @member {Array.} environments - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @instance - */ - ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + /** + * WebServerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.memoryGb = 0; - /** - * ListEnvironmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @instance - */ - ListEnvironmentsResponse.prototype.nextPageToken = ""; + /** + * WebServerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.storageGb = 0; - /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance - */ - ListEnvironmentsResponse.create = function create(properties) { - return new ListEnvironmentsResponse(properties); - }; + /** + * Creates a new WebServerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource instance + */ + WebServerResource.create = function create(properties) { + return new WebServerResource(properties); + }; - /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEnvironmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.environments != null && message.environments.length) - for (var i = 0; i < message.environments.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environments[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; - }; + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + return writer; + }; - /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEnvironmentsResponse.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.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.environments && message.environments.length)) - message.environments = []; - message.environments.push($root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.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.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListEnvironmentsResponse message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEnvironmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!Array.isArray(message.environments)) - return "environments: array expected"; - for (var i = 0; i < message.environments.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environments[i]); - if (error) - return "environments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * Verifies a WebServerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + return null; + }; - /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse - */ - ListEnvironmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); - if (object.environments) { - if (!Array.isArray(object.environments)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: array expected"); - message.environments = []; - for (var i = 0; i < object.environments.length; ++i) { - if (typeof object.environments[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: object expected"); - message.environments[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environments[i]); + /** + * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} WebServerResource + */ + WebServerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + return message; + }; + + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource} message WebServerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + return object; + }; - /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEnvironmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.environments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.environments && message.environments.length) { - object.environments = []; - for (var j = 0; j < message.environments.length; ++j) - object.environments[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * Converts this WebServerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @instance + * @returns {Object.} JSON object + */ + WebServerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListEnvironmentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEnvironmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for WebServerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WebServerResource"; + }; - /** - * Gets the default type url for ListEnvironmentsResponse - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse"; - }; + return WebServerResource; + })(); - return ListEnvironmentsResponse; - })(); + WorkloadsConfig.WorkerResource = (function() { - v1beta1.DeleteEnvironmentRequest = (function() { + /** + * Properties of a WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @interface IWorkerResource + * @property {number|null} [cpu] WorkerResource cpu + * @property {number|null} [memoryGb] WorkerResource memoryGb + * @property {number|null} [storageGb] WorkerResource storageGb + * @property {number|null} [minCount] WorkerResource minCount + * @property {number|null} [maxCount] WorkerResource maxCount + */ - /** - * Properties of a DeleteEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IDeleteEnvironmentRequest - * @property {string|null} [name] DeleteEnvironmentRequest name - */ + /** + * Constructs a new WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig + * @classdesc Represents a WorkerResource. + * @implements IWorkerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + */ + function WorkerResource(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]]; + } - /** - * Constructs a new DeleteEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a DeleteEnvironmentRequest. - * @implements IDeleteEnvironmentRequest - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set - */ - function DeleteEnvironmentRequest(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]]; - } + /** + * WorkerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.cpu = 0; - /** - * DeleteEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @instance - */ - DeleteEnvironmentRequest.prototype.name = ""; + /** + * WorkerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.memoryGb = 0; - /** - * Creates a new DeleteEnvironmentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance - */ - DeleteEnvironmentRequest.create = function create(properties) { - return new DeleteEnvironmentRequest(properties); - }; + /** + * WorkerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.storageGb = 0; - /** - * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEnvironmentRequest.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; - }; + /** + * WorkerResource minCount. + * @member {number} minCount + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.minCount = 0; - /** - * Encodes the specified DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * WorkerResource maxCount. + * @member {number} maxCount + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.maxCount = 0; - /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteEnvironmentRequest.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.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + /** + * Creates a new WorkerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource instance + */ + WorkerResource.create = function create(properties) { + return new WorkerResource(properties); + }; + + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minCount); + if (message.maxCount != null && Object.hasOwnProperty.call(message, "maxCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxCount); + return writer; + }; + + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.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.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.minCount = reader.int32(); + break; + } + case 5: { + message.maxCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; + + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.minCount != null && message.hasOwnProperty("minCount")) + if (!$util.isInteger(message.minCount)) + return "minCount: integer expected"; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + if (!$util.isInteger(message.maxCount)) + return "maxCount: integer expected"; + return null; + }; + + /** + * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} WorkerResource + */ + WorkerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.minCount != null) + message.minCount = object.minCount | 0; + if (object.maxCount != null) + message.maxCount = object.maxCount | 0; + return message; + }; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource} message WorkerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.minCount = 0; + object.maxCount = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.minCount != null && message.hasOwnProperty("minCount")) + object.minCount = message.minCount; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + object.maxCount = message.maxCount; + return object; + }; + + /** + * Converts this WorkerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @instance + * @returns {Object.} JSON object + */ + WorkerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.WorkloadsConfig.WorkerResource"; + }; + + return WorkerResource; + })(); + + return WorkloadsConfig; + })(); + + v1.RecoveryConfig = (function() { /** - * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Properties of a RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IRecoveryConfig + * @property {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null} [scheduledSnapshotsConfig] RecoveryConfig scheduledSnapshotsConfig */ - DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a DeleteEnvironmentRequest message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Constructs a new RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a RecoveryConfig. + * @implements IRecoveryConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set */ - DeleteEnvironmentRequest.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"; + function RecoveryConfig(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]]; + } + + /** + * RecoveryConfig scheduledSnapshotsConfig. + * @member {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig|null|undefined} scheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @instance + */ + RecoveryConfig.prototype.scheduledSnapshotsConfig = null; + + /** + * Creates a new RecoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig instance + */ + RecoveryConfig.create = function create(properties) { + return new RecoveryConfig(properties); + }; + + /** + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledSnapshotsConfig != null && Object.hasOwnProperty.call(message, "scheduledSnapshotsConfig")) + $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.encode(message.scheduledSnapshotsConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.RecoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.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.orchestration.airflow.service.v1.RecoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecoveryConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify(message.scheduledSnapshotsConfig); + if (error) + return "scheduledSnapshotsConfig." + error; + } return null; }; /** - * Creates a DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} RecoveryConfig */ - DeleteEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest) + RecoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.orchestration.airflow.service.v1.RecoveryConfig(); + if (object.scheduledSnapshotsConfig != null) { + if (typeof object.scheduledSnapshotsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.RecoveryConfig.scheduledSnapshotsConfig: object expected"); + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.fromObject(object.scheduledSnapshotsConfig); + } return message; }; /** - * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1.RecoveryConfig} message RecoveryConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteEnvironmentRequest.toObject = function toObject(message, options) { + RecoveryConfig.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; + object.scheduledSnapshotsConfig = null; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) + object.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.toObject(message.scheduledSnapshotsConfig, options); return object; }; /** - * Converts this DeleteEnvironmentRequest to JSON. + * Converts this RecoveryConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig * @instance * @returns {Object.} JSON object */ - DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + RecoveryConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteEnvironmentRequest + * Gets the default type url for RecoveryConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.RecoveryConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RecoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.RecoveryConfig"; }; - return DeleteEnvironmentRequest; + return RecoveryConfig; })(); - v1beta1.UpdateEnvironmentRequest = (function() { + v1.ScheduledSnapshotsConfig = (function() { /** - * Properties of an UpdateEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IUpdateEnvironmentRequest - * @property {string|null} [name] UpdateEnvironmentRequest name - * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + * Properties of a ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IScheduledSnapshotsConfig + * @property {boolean|null} [enabled] ScheduledSnapshotsConfig enabled + * @property {string|null} [snapshotLocation] ScheduledSnapshotsConfig snapshotLocation + * @property {string|null} [snapshotCreationSchedule] ScheduledSnapshotsConfig snapshotCreationSchedule + * @property {string|null} [timeZone] ScheduledSnapshotsConfig timeZone */ /** - * Constructs a new UpdateEnvironmentRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an UpdateEnvironmentRequest. - * @implements IUpdateEnvironmentRequest + * Constructs a new ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a ScheduledSnapshotsConfig. + * @implements IScheduledSnapshotsConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set */ - function UpdateEnvironmentRequest(properties) { + function ScheduledSnapshotsConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8570,103 +8090,117 @@ } /** - * UpdateEnvironmentRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * ScheduledSnapshotsConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @instance */ - UpdateEnvironmentRequest.prototype.name = ""; + ScheduledSnapshotsConfig.prototype.enabled = false; /** - * UpdateEnvironmentRequest environment. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * ScheduledSnapshotsConfig snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @instance */ - UpdateEnvironmentRequest.prototype.environment = null; + ScheduledSnapshotsConfig.prototype.snapshotLocation = ""; /** - * UpdateEnvironmentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * ScheduledSnapshotsConfig snapshotCreationSchedule. + * @member {string} snapshotCreationSchedule + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @instance */ - UpdateEnvironmentRequest.prototype.updateMask = null; + ScheduledSnapshotsConfig.prototype.snapshotCreationSchedule = ""; /** - * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * ScheduledSnapshotsConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.timeZone = ""; + + /** + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig instance */ - UpdateEnvironmentRequest.create = function create(properties) { - return new UpdateEnvironmentRequest(properties); + ScheduledSnapshotsConfig.create = function create(properties) { + return new ScheduledSnapshotsConfig(properties); }; /** - * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEnvironmentRequest.encode = function encode(message, writer) { + ScheduledSnapshotsConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.snapshotCreationSchedule != null && Object.hasOwnProperty.call(message, "snapshotCreationSchedule")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotCreationSchedule); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.snapshotLocation); return writer; }; /** - * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ScheduledSnapshotsConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEnvironmentRequest.decode = function decode(reader, length) { + ScheduledSnapshotsConfig.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.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: { - message.name = reader.string(); + case 1: { + message.enabled = reader.bool(); break; } - case 1: { - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + case 6: { + message.snapshotLocation = reader.string(); break; } case 3: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.snapshotCreationSchedule = reader.string(); + break; + } + case 5: { + message.timeZone = reader.string(); break; } default: @@ -8678,149 +8212,149 @@ }; /** - * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + ScheduledSnapshotsConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateEnvironmentRequest message. + * Verifies a ScheduledSnapshotsConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateEnvironmentRequest.verify = function verify(message) { + ScheduledSnapshotsConfig.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.environment != null && message.hasOwnProperty("environment")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); - if (error) - return "environment." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + if (!$util.isString(message.snapshotCreationSchedule)) + return "snapshotCreationSchedule: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; return null; }; /** - * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @returns {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig */ - UpdateEnvironmentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest) + ScheduledSnapshotsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.environment != null) { - if (typeof object.environment !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.environment: object expected"); - message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); + if (object.snapshotCreationSchedule != null) + message.snapshotCreationSchedule = String(object.snapshotCreationSchedule); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); return message; }; /** - * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig} message ScheduledSnapshotsConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateEnvironmentRequest.toObject = function toObject(message, options) { + ScheduledSnapshotsConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.environment = null; - object.name = ""; - object.updateMask = null; - } - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + object.enabled = false; + object.snapshotCreationSchedule = ""; + object.timeZone = ""; + object.snapshotLocation = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + object.snapshotCreationSchedule = message.snapshotCreationSchedule; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; return object; }; /** - * Converts this UpdateEnvironmentRequest to JSON. + * Converts this ScheduledSnapshotsConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @instance * @returns {Object.} JSON object */ - UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + ScheduledSnapshotsConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateEnvironmentRequest + * Gets the default type url for ScheduledSnapshotsConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @memberof google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ScheduledSnapshotsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ScheduledSnapshotsConfig"; }; - return UpdateEnvironmentRequest; + return ScheduledSnapshotsConfig; })(); - v1beta1.RestartWebServerRequest = (function() { + v1.MasterAuthorizedNetworksConfig = (function() { /** - * Properties of a RestartWebServerRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IRestartWebServerRequest - * @property {string|null} [name] RestartWebServerRequest name + * Properties of a MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IMasterAuthorizedNetworksConfig + * @property {boolean|null} [enabled] MasterAuthorizedNetworksConfig enabled + * @property {Array.|null} [cidrBlocks] MasterAuthorizedNetworksConfig cidrBlocks */ /** - * Constructs a new RestartWebServerRequest. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a RestartWebServerRequest. - * @implements IRestartWebServerRequest + * Constructs a new MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a MasterAuthorizedNetworksConfig. + * @implements IMasterAuthorizedNetworksConfig * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set */ - function RestartWebServerRequest(properties) { + function MasterAuthorizedNetworksConfig(properties) { + this.cidrBlocks = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8828,75 +8362,92 @@ } /** - * RestartWebServerRequest name. - * @member {string} name - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * MasterAuthorizedNetworksConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @instance */ - RestartWebServerRequest.prototype.name = ""; + MasterAuthorizedNetworksConfig.prototype.enabled = false; /** - * Creates a new RestartWebServerRequest instance using the specified properties. + * MasterAuthorizedNetworksConfig cidrBlocks. + * @member {Array.} cidrBlocks + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @instance + */ + MasterAuthorizedNetworksConfig.prototype.cidrBlocks = $util.emptyArray; + + /** + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest instance + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig instance */ - RestartWebServerRequest.create = function create(properties) { - return new RestartWebServerRequest(properties); + MasterAuthorizedNetworksConfig.create = function create(properties) { + return new MasterAuthorizedNetworksConfig(properties); }; /** - * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartWebServerRequest.encode = function encode(message, writer) { + MasterAuthorizedNetworksConfig.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.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.cidrBlocks != null && message.cidrBlocks.length) + for (var i = 0; i < message.cidrBlocks.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.encode(message.cidrBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestartWebServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + MasterAuthorizedNetworksConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartWebServerRequest.decode = function decode(reader, length) { + MasterAuthorizedNetworksConfig.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.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.enabled = reader.bool(); + break; + } + case 2: { + if (!(message.cidrBlocks && message.cidrBlocks.length)) + message.cidrBlocks = []; + message.cidrBlocks.push($root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.decode(reader, reader.uint32())); break; } default: @@ -8908,135 +8459,382 @@ }; /** - * Decodes a RestartWebServerRequest message from the specified reader or buffer, length delimited. + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestartWebServerRequest.decodeDelimited = function decodeDelimited(reader) { + MasterAuthorizedNetworksConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestartWebServerRequest message. + * Verifies a MasterAuthorizedNetworksConfig message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestartWebServerRequest.verify = function verify(message) { + MasterAuthorizedNetworksConfig.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.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.cidrBlocks != null && message.hasOwnProperty("cidrBlocks")) { + if (!Array.isArray(message.cidrBlocks)) + return "cidrBlocks: array expected"; + for (var i = 0; i < message.cidrBlocks.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify(message.cidrBlocks[i]); + if (error) + return "cidrBlocks." + error; + } + } return null; }; /** - * Creates a RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig */ - RestartWebServerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest) + MasterAuthorizedNetworksConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.cidrBlocks) { + if (!Array.isArray(object.cidrBlocks)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: array expected"); + message.cidrBlocks = []; + for (var i = 0; i < object.cidrBlocks.length; ++i) { + if (typeof object.cidrBlocks[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.cidrBlocks: object expected"); + message.cidrBlocks[i] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.fromObject(object.cidrBlocks[i]); + } + } return message; }; /** - * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} message RestartWebServerRequest + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestartWebServerRequest.toObject = function toObject(message, options) { + MasterAuthorizedNetworksConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.cidrBlocks = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.cidrBlocks && message.cidrBlocks.length) { + object.cidrBlocks = []; + for (var j = 0; j < message.cidrBlocks.length; ++j) + object.cidrBlocks[j] = $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.toObject(message.cidrBlocks[j], options); + } return object; }; /** - * Converts this RestartWebServerRequest to JSON. + * Converts this MasterAuthorizedNetworksConfig to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @instance * @returns {Object.} JSON object */ - RestartWebServerRequest.prototype.toJSON = function toJSON() { + MasterAuthorizedNetworksConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RestartWebServerRequest + * Gets the default type url for MasterAuthorizedNetworksConfig * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RestartWebServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MasterAuthorizedNetworksConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig"; }; - return RestartWebServerRequest; + MasterAuthorizedNetworksConfig.CidrBlock = (function() { + + /** + * Properties of a CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @interface ICidrBlock + * @property {string|null} [displayName] CidrBlock displayName + * @property {string|null} [cidrBlock] CidrBlock cidrBlock + */ + + /** + * Constructs a new CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig + * @classdesc Represents a CidrBlock. + * @implements ICidrBlock + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set + */ + function CidrBlock(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]]; + } + + /** + * CidrBlock displayName. + * @member {string} displayName + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + */ + CidrBlock.prototype.displayName = ""; + + /** + * CidrBlock cidrBlock. + * @member {string} cidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + */ + CidrBlock.prototype.cidrBlock = ""; + + /** + * Creates a new CidrBlock instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock instance + */ + CidrBlock.create = function create(properties) { + return new CidrBlock(properties); + }; + + /** + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CidrBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cidrBlock != null && Object.hasOwnProperty.call(message, "cidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cidrBlock); + return writer; + }; + + /** + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CidrBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CidrBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CidrBlock.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.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.cidrBlock = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CidrBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CidrBlock message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CidrBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + if (!$util.isString(message.cidrBlock)) + return "cidrBlock: string expected"; + return null; + }; + + /** + * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock + */ + CidrBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cidrBlock != null) + message.cidrBlock = String(object.cidrBlock); + return message; + }; + + /** + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock} message CidrBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CidrBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.cidrBlock = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + object.cidrBlock = message.cidrBlock; + return object; + }; + + /** + * Converts this CidrBlock to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @instance + * @returns {Object.} JSON object + */ + CidrBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CidrBlock + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CidrBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.MasterAuthorizedNetworksConfig.CidrBlock"; + }; + + return CidrBlock; + })(); + + return MasterAuthorizedNetworksConfig; })(); - v1beta1.EnvironmentConfig = (function() { + v1.Environment = (function() { /** - * Properties of an EnvironmentConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IEnvironmentConfig - * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster - * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix - * @property {number|null} [nodeCount] EnvironmentConfig nodeCount - * @property {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl - * @property {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig - * @property {string|null} [airflowUri] EnvironmentConfig airflowUri - * @property {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null} [maintenanceWindow] EnvironmentConfig maintenanceWindow - * @property {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null} [workloadsConfig] EnvironmentConfig workloadsConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize + * Properties of an Environment. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null} [config] Environment config + * @property {string|null} [uuid] Environment uuid + * @property {google.cloud.orchestration.airflow.service.v1.Environment.State|null} [state] Environment state + * @property {google.protobuf.ITimestamp|null} [createTime] Environment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @property {Object.|null} [labels] Environment labels */ /** - * Constructs a new EnvironmentConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an EnvironmentConfig. - * @implements IEnvironmentConfig + * Constructs a new Environment. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an Environment. + * @implements IEnvironment * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set */ - function EnvironmentConfig(properties) { + function Environment(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9044,257 +8842,179 @@ } /** - * EnvironmentConfig gkeCluster. - * @member {string} gkeCluster - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.gkeCluster = ""; + Environment.prototype.name = ""; /** - * EnvironmentConfig dagGcsPrefix. - * @member {string} dagGcsPrefix - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.dagGcsPrefix = ""; - - /** - * EnvironmentConfig nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.nodeCount = 0; - - /** - * EnvironmentConfig softwareConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null|undefined} softwareConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.softwareConfig = null; - - /** - * EnvironmentConfig nodeConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null|undefined} nodeConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.nodeConfig = null; - - /** - * EnvironmentConfig privateEnvironmentConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.privateEnvironmentConfig = null; - - /** - * EnvironmentConfig webServerNetworkAccessControl. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.webServerNetworkAccessControl = null; - - /** - * EnvironmentConfig databaseConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null|undefined} databaseConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.databaseConfig = null; - - /** - * EnvironmentConfig webServerConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null|undefined} webServerConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment config. + * @member {google.cloud.orchestration.airflow.service.v1.IEnvironmentConfig|null|undefined} config + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.webServerConfig = null; + Environment.prototype.config = null; /** - * EnvironmentConfig airflowUri. - * @member {string} airflowUri - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment uuid. + * @member {string} uuid + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.airflowUri = ""; + Environment.prototype.uuid = ""; /** - * EnvironmentConfig encryptionConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment state. + * @member {google.cloud.orchestration.airflow.service.v1.Environment.State} state + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.encryptionConfig = null; + Environment.prototype.state = 0; /** - * EnvironmentConfig maintenanceWindow. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null|undefined} maintenanceWindow - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.maintenanceWindow = null; + Environment.prototype.createTime = null; /** - * EnvironmentConfig workloadsConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null|undefined} workloadsConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.workloadsConfig = null; + Environment.prototype.updateTime = null; /** - * EnvironmentConfig environmentSize. - * @member {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize} environmentSize - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * Environment labels. + * @member {Object.} labels + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance */ - EnvironmentConfig.prototype.environmentSize = 0; + Environment.prototype.labels = $util.emptyObject; /** - * Creates a new EnvironmentConfig instance using the specified properties. + * Creates a new Environment instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment instance */ - EnvironmentConfig.create = function create(properties) { - return new EnvironmentConfig(properties); + Environment.create = function create(properties) { + return new Environment(properties); }; /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encode = function encode(message, writer) { + Environment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); - if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); - if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); - if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) - $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.workloadsConfig != null && Object.hasOwnProperty.call(message, "workloadsConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.encode(message.workloadsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.environmentSize != null && Object.hasOwnProperty.call(message, "environmentSize")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.environmentSize); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uuid); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).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 7, wireType 2 =*/58).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 EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.Environment.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IEnvironment} message Environment message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + Environment.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. + * Decodes an Environment message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decode = function decode(reader, length) { + Environment.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.orchestration.airflow.service.v1beta1.EnvironmentConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.gkeCluster = reader.string(); + message.name = reader.string(); break; } case 2: { - message.dagGcsPrefix = reader.string(); + message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.decode(reader, reader.uint32()); break; } case 3: { - message.nodeCount = reader.int32(); + message.uuid = reader.string(); break; } case 4: { - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.decode(reader, reader.uint32()); + message.state = reader.int32(); break; } case 5: { - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); - break; - } - case 10: { - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.decode(reader, reader.uint32()); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 6: { - message.airflowUri = reader.string(); - break; - } - case 12: { - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.decode(reader, reader.uint32()); - break; - } - case 15: { - message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.decode(reader, reader.uint32()); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 16: { - message.environmentSize = reader.int32(); + case 7: { + 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: @@ -9306,320 +9026,267 @@ }; /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * Decodes an Environment message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + Environment.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnvironmentConfig message. + * Verifies an Environment message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EnvironmentConfig.verify = function verify(message) { + Environment.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - if (!$util.isString(message.gkeCluster)) - return "gkeCluster: string expected"; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - if (!$util.isString(message.dagGcsPrefix)) - return "dagGcsPrefix: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify(message.softwareConfig); - if (error) - return "softwareConfig." + error; - } - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify(message.nodeConfig); - if (error) - return "nodeConfig." + error; - } - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); - if (error) - return "privateEnvironmentConfig." + error; - } - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); - if (error) - return "webServerNetworkAccessControl." + error; - } - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify(message.databaseConfig); - if (error) - return "databaseConfig." + error; - } - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify(message.webServerConfig); - if (error) - return "webServerConfig." + error; - } - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - if (!$util.isString(message.airflowUri)) - return "airflowUri: string expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify(message.maintenanceWindow); - if (error) - return "maintenanceWindow." + error; - } - if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify(message.workloadsConfig); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.verify(message.config); if (error) - return "workloadsConfig." + error; + return "config." + error; } - if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) - switch (message.environmentSize) { + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { default: - return "environmentSize: enum value expected"; + return "state: enum value expected"; case 0: case 1: case 2: case 3: + case 4: + case 5: break; } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + 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 an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * Creates an Environment message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + * @returns {google.cloud.orchestration.airflow.service.v1.Environment} Environment */ - EnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig) + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.Environment) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig(); - if (object.gkeCluster != null) - message.gkeCluster = String(object.gkeCluster); - if (object.dagGcsPrefix != null) - message.dagGcsPrefix = String(object.dagGcsPrefix); - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.softwareConfig != null) { - if (typeof object.softwareConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.softwareConfig: object expected"); - message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.fromObject(object.softwareConfig); - } - if (object.nodeConfig != null) { - if (typeof object.nodeConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.nodeConfig: object expected"); - message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.fromObject(object.nodeConfig); - } - if (object.privateEnvironmentConfig != null) { - if (typeof object.privateEnvironmentConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.privateEnvironmentConfig: object expected"); - message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); - } - if (object.webServerNetworkAccessControl != null) { - if (typeof object.webServerNetworkAccessControl !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); - message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); - } - if (object.databaseConfig != null) { - if (typeof object.databaseConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.databaseConfig: object expected"); - message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.fromObject(object.databaseConfig); - } - if (object.webServerConfig != null) { - if (typeof object.webServerConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.webServerConfig: object expected"); - message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.fromObject(object.webServerConfig); - } - if (object.airflowUri != null) - message.airflowUri = String(object.airflowUri); - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.maintenanceWindow != null) { - if (typeof object.maintenanceWindow !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.maintenanceWindow: object expected"); - message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.fromObject(object.maintenanceWindow); - } - if (object.workloadsConfig != null) { - if (typeof object.workloadsConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.workloadsConfig: object expected"); - message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.fromObject(object.workloadsConfig); + var message = new $root.google.cloud.orchestration.airflow.service.v1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.config: object expected"); + message.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.fromObject(object.config); } - switch (object.environmentSize) { + if (object.uuid != null) + message.uuid = String(object.uuid); + switch (object.state) { default: - if (typeof object.environmentSize === "number") { - message.environmentSize = object.environmentSize; + if (typeof object.state === "number") { + message.state = object.state; break; } break; - case "ENVIRONMENT_SIZE_UNSPECIFIED": + case "STATE_UNSPECIFIED": case 0: - message.environmentSize = 0; + message.state = 0; break; - case "ENVIRONMENT_SIZE_SMALL": + case "CREATING": case 1: - message.environmentSize = 1; + message.state = 1; break; - case "ENVIRONMENT_SIZE_MEDIUM": + case "RUNNING": case 2: - message.environmentSize = 2; + message.state = 2; break; - case "ENVIRONMENT_SIZE_LARGE": + case "UPDATING": case 3: - message.environmentSize = 3; + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "ERROR": + case 5: + message.state = 5; break; } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.Environment.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 an EnvironmentConfig message. Also converts values to other types if specified. + * Creates a plain object from an Environment message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} message EnvironmentConfig + * @param {google.cloud.orchestration.airflow.service.v1.Environment} message Environment * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnvironmentConfig.toObject = function toObject(message, options) { + Environment.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.gkeCluster = ""; - object.dagGcsPrefix = ""; - object.nodeCount = 0; - object.softwareConfig = null; - object.nodeConfig = null; - object.airflowUri = ""; - object.privateEnvironmentConfig = null; - object.webServerNetworkAccessControl = null; - object.databaseConfig = null; - object.webServerConfig = null; - object.encryptionConfig = null; - object.maintenanceWindow = null; - object.workloadsConfig = null; - object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; + object.name = ""; + object.config = null; + object.uuid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig.toObject(message.config, options); + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.Environment.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, 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.gkeCluster != null && message.hasOwnProperty("gkeCluster")) - object.gkeCluster = message.gkeCluster; - if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) - object.dagGcsPrefix = message.dagGcsPrefix; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) - object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.toObject(message.softwareConfig, options); - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) - object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.toObject(message.nodeConfig, options); - if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) - object.airflowUri = message.airflowUri; - if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) - object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); - if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) - object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); - if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) - object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.toObject(message.databaseConfig, options); - if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) - object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.toObject(message.webServerConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) - object.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.toObject(message.maintenanceWindow, options); - if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) - object.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.toObject(message.workloadsConfig, options); - if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) - object.environmentSize = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize[message.environmentSize] === undefined ? message.environmentSize : $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize[message.environmentSize] : message.environmentSize; return object; }; /** - * Converts this EnvironmentConfig to JSON. + * Converts this Environment to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @instance * @returns {Object.} JSON object */ - EnvironmentConfig.prototype.toJSON = function toJSON() { + Environment.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EnvironmentConfig + * Gets the default type url for Environment * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1.Environment * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.Environment"; }; /** - * EnvironmentSize enum. - * @name google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize + * State enum. + * @name google.cloud.orchestration.airflow.service.v1.Environment.State * @enum {number} - * @property {number} ENVIRONMENT_SIZE_UNSPECIFIED=0 ENVIRONMENT_SIZE_UNSPECIFIED value - * @property {number} ENVIRONMENT_SIZE_SMALL=1 ENVIRONMENT_SIZE_SMALL value - * @property {number} ENVIRONMENT_SIZE_MEDIUM=2 ENVIRONMENT_SIZE_MEDIUM value - * @property {number} ENVIRONMENT_SIZE_LARGE=3 ENVIRONMENT_SIZE_LARGE value + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} ERROR=5 ERROR value */ - EnvironmentConfig.EnvironmentSize = (function() { + Environment.State = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENVIRONMENT_SIZE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENVIRONMENT_SIZE_SMALL"] = 1; - values[valuesById[2] = "ENVIRONMENT_SIZE_MEDIUM"] = 2; - values[valuesById[3] = "ENVIRONMENT_SIZE_LARGE"] = 3; + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "ERROR"] = 5; return values; })(); - return EnvironmentConfig; + return Environment; })(); - v1beta1.WebServerNetworkAccessControl = (function() { + v1.CheckUpgradeResponse = (function() { /** - * Properties of a WebServerNetworkAccessControl. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IWebServerNetworkAccessControl - * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges + * Properties of a CheckUpgradeResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface ICheckUpgradeResponse + * @property {string|null} [buildLogUri] CheckUpgradeResponse buildLogUri + * @property {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult|null} [containsPypiModulesConflict] CheckUpgradeResponse containsPypiModulesConflict + * @property {string|null} [pypiConflictBuildLogExtract] CheckUpgradeResponse pypiConflictBuildLogExtract + * @property {string|null} [imageVersion] CheckUpgradeResponse imageVersion + * @property {Object.|null} [pypiDependencies] CheckUpgradeResponse pypiDependencies */ /** - * Constructs a new WebServerNetworkAccessControl. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a WebServerNetworkAccessControl. - * @implements IWebServerNetworkAccessControl + * Constructs a new CheckUpgradeResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a CheckUpgradeResponse. + * @implements ICheckUpgradeResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set */ - function WebServerNetworkAccessControl(properties) { - this.allowedIpRanges = []; + function CheckUpgradeResponse(properties) { + this.pypiDependencies = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9627,78 +9294,151 @@ } /** - * WebServerNetworkAccessControl allowedIpRanges. - * @member {Array.} allowedIpRanges - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * CheckUpgradeResponse buildLogUri. + * @member {string} buildLogUri + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @instance */ - WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; + CheckUpgradeResponse.prototype.buildLogUri = ""; /** - * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * CheckUpgradeResponse containsPypiModulesConflict. + * @member {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult} containsPypiModulesConflict + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.containsPypiModulesConflict = 0; + + /** + * CheckUpgradeResponse pypiConflictBuildLogExtract. + * @member {string} pypiConflictBuildLogExtract + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.pypiConflictBuildLogExtract = ""; + + /** + * CheckUpgradeResponse imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.imageVersion = ""; + + /** + * CheckUpgradeResponse pypiDependencies. + * @member {Object.} pypiDependencies + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse + * @instance + */ + CheckUpgradeResponse.prototype.pypiDependencies = $util.emptyObject; + + /** + * Creates a new CheckUpgradeResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse instance */ - WebServerNetworkAccessControl.create = function create(properties) { - return new WebServerNetworkAccessControl(properties); + CheckUpgradeResponse.create = function create(properties) { + return new CheckUpgradeResponse(properties); }; /** - * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * Encodes the specified CheckUpgradeResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerNetworkAccessControl.encode = function encode(message, writer) { + CheckUpgradeResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowedIpRanges != null && message.allowedIpRanges.length) - for (var i = 0; i < message.allowedIpRanges.length; ++i) - $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.buildLogUri != null && Object.hasOwnProperty.call(message, "buildLogUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildLogUri); + if (message.pypiConflictBuildLogExtract != null && Object.hasOwnProperty.call(message, "pypiConflictBuildLogExtract")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pypiConflictBuildLogExtract); + if (message.containsPypiModulesConflict != null && Object.hasOwnProperty.call(message, "containsPypiModulesConflict")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.containsPypiModulesConflict); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.imageVersion); + if (message.pypiDependencies != null && Object.hasOwnProperty.call(message, "pypiDependencies")) + for (var keys = Object.keys(message.pypiDependencies), 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.pypiDependencies[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * Encodes the specified CheckUpgradeResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.ICheckUpgradeResponse} message CheckUpgradeResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + CheckUpgradeResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * Decodes a CheckUpgradeResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerNetworkAccessControl.decode = function decode(reader, length) { + CheckUpgradeResponse.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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.allowedIpRanges && message.allowedIpRanges.length)) - message.allowedIpRanges = []; - message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); + message.buildLogUri = reader.string(); + break; + } + case 4: { + message.containsPypiModulesConflict = reader.int32(); + break; + } + case 3: { + message.pypiConflictBuildLogExtract = reader.string(); + break; + } + case 5: { + message.imageVersion = reader.string(); + break; + } + case 6: { + if (message.pypiDependencies === $util.emptyObject) + message.pypiDependencies = {}; + 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.pypiDependencies[key] = value; break; } default: @@ -9710,373 +9450,281 @@ }; /** - * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * Decodes a CheckUpgradeResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { + CheckUpgradeResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebServerNetworkAccessControl message. + * Verifies a CheckUpgradeResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebServerNetworkAccessControl.verify = function verify(message) { + CheckUpgradeResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { - if (!Array.isArray(message.allowedIpRanges)) - return "allowedIpRanges: array expected"; - for (var i = 0; i < message.allowedIpRanges.length; ++i) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); - if (error) - return "allowedIpRanges." + error; - } - } + if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) + if (!$util.isString(message.buildLogUri)) + return "buildLogUri: string expected"; + if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) + switch (message.containsPypiModulesConflict) { + default: + return "containsPypiModulesConflict: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) + if (!$util.isString(message.pypiConflictBuildLogExtract)) + return "pypiConflictBuildLogExtract: string expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.pypiDependencies != null && message.hasOwnProperty("pypiDependencies")) { + if (!$util.isObject(message.pypiDependencies)) + return "pypiDependencies: object expected"; + var key = Object.keys(message.pypiDependencies); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.pypiDependencies[key[i]])) + return "pypiDependencies: string{k:string} expected"; + } return null; }; /** - * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * Creates a CheckUpgradeResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @returns {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} CheckUpgradeResponse */ - WebServerNetworkAccessControl.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl) + CheckUpgradeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl(); - if (object.allowedIpRanges) { - if (!Array.isArray(object.allowedIpRanges)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); - message.allowedIpRanges = []; - for (var i = 0; i < object.allowedIpRanges.length; ++i) { - if (typeof object.allowedIpRanges[i] !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); - message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); + var message = new $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse(); + if (object.buildLogUri != null) + message.buildLogUri = String(object.buildLogUri); + switch (object.containsPypiModulesConflict) { + default: + if (typeof object.containsPypiModulesConflict === "number") { + message.containsPypiModulesConflict = object.containsPypiModulesConflict; + break; } + break; + case "CONFLICT_RESULT_UNSPECIFIED": + case 0: + message.containsPypiModulesConflict = 0; + break; + case "CONFLICT": + case 1: + message.containsPypiModulesConflict = 1; + break; + case "NO_CONFLICT": + case 2: + message.containsPypiModulesConflict = 2; + break; + } + if (object.pypiConflictBuildLogExtract != null) + message.pypiConflictBuildLogExtract = String(object.pypiConflictBuildLogExtract); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.pypiDependencies) { + if (typeof object.pypiDependencies !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.pypiDependencies: object expected"); + message.pypiDependencies = {}; + for (var keys = Object.keys(object.pypiDependencies), i = 0; i < keys.length; ++i) + message.pypiDependencies[keys[i]] = String(object.pypiDependencies[keys[i]]); } return message; }; /** - * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * Creates a plain object from a CheckUpgradeResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl + * @param {google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse} message CheckUpgradeResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebServerNetworkAccessControl.toObject = function toObject(message, options) { + CheckUpgradeResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.allowedIpRanges = []; - if (message.allowedIpRanges && message.allowedIpRanges.length) { - object.allowedIpRanges = []; - for (var j = 0; j < message.allowedIpRanges.length; ++j) - object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); + if (options.objects || options.defaults) + object.pypiDependencies = {}; + if (options.defaults) { + object.buildLogUri = ""; + object.pypiConflictBuildLogExtract = ""; + object.containsPypiModulesConflict = options.enums === String ? "CONFLICT_RESULT_UNSPECIFIED" : 0; + object.imageVersion = ""; + } + if (message.buildLogUri != null && message.hasOwnProperty("buildLogUri")) + object.buildLogUri = message.buildLogUri; + if (message.pypiConflictBuildLogExtract != null && message.hasOwnProperty("pypiConflictBuildLogExtract")) + object.pypiConflictBuildLogExtract = message.pypiConflictBuildLogExtract; + if (message.containsPypiModulesConflict != null && message.hasOwnProperty("containsPypiModulesConflict")) + object.containsPypiModulesConflict = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] === undefined ? message.containsPypiModulesConflict : $root.google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult[message.containsPypiModulesConflict] : message.containsPypiModulesConflict; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + var keys2; + if (message.pypiDependencies && (keys2 = Object.keys(message.pypiDependencies)).length) { + object.pypiDependencies = {}; + for (var j = 0; j < keys2.length; ++j) + object.pypiDependencies[keys2[j]] = message.pypiDependencies[keys2[j]]; } return object; }; /** - * Converts this WebServerNetworkAccessControl to JSON. + * Converts this CheckUpgradeResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @instance * @returns {Object.} JSON object */ - WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { + CheckUpgradeResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WebServerNetworkAccessControl + * Gets the default type url for CheckUpgradeResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CheckUpgradeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse"; }; - WebServerNetworkAccessControl.AllowedIpRange = (function() { + /** + * ConflictResult enum. + * @name google.cloud.orchestration.airflow.service.v1.CheckUpgradeResponse.ConflictResult + * @enum {number} + * @property {number} CONFLICT_RESULT_UNSPECIFIED=0 CONFLICT_RESULT_UNSPECIFIED value + * @property {number} CONFLICT=1 CONFLICT value + * @property {number} NO_CONFLICT=2 NO_CONFLICT value + */ + CheckUpgradeResponse.ConflictResult = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONFLICT_RESULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONFLICT"] = 1; + values[valuesById[2] = "NO_CONFLICT"] = 2; + return values; + })(); - /** - * Properties of an AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl - * @interface IAllowedIpRange - * @property {string|null} [value] AllowedIpRange value - * @property {string|null} [description] AllowedIpRange description - */ + return CheckUpgradeResponse; + })(); - /** - * Constructs a new AllowedIpRange. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl - * @classdesc Represents an AllowedIpRange. - * @implements IAllowedIpRange - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set - */ - function AllowedIpRange(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]]; - } + v1.ImageVersions = (function() { - /** - * AllowedIpRange value. - * @member {string} value - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - */ - AllowedIpRange.prototype.value = ""; + /** + * Constructs a new ImageVersions service. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an ImageVersions + * @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 ImageVersions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * AllowedIpRange description. - * @member {string} description - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - */ - AllowedIpRange.prototype.description = ""; + (ImageVersions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ImageVersions; - /** - * Creates a new AllowedIpRange instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance - */ - AllowedIpRange.create = function create(properties) { - return new AllowedIpRange(properties); - }; + /** + * Creates new ImageVersions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @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 {ImageVersions} RPC service. Useful where requests and/or responses are streamed. + */ + ImageVersions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedIpRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - return writer; - }; + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1.ImageVersions|listImageVersions}. + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @typedef ListImageVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} [response] ListImageVersionsResponse + */ - /** - * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedIpRange.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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllowedIpRange message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllowedIpRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - return null; - }; - - /** - * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange - */ - AllowedIpRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange(); - if (object.value != null) - message.value = String(object.value); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllowedIpRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.description = ""; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this AllowedIpRange to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @instance - * @returns {Object.} JSON object - */ - AllowedIpRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllowedIpRange - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange"; - }; + /** + * Calls ListImageVersions. + * @function listImageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1.ImageVersions.ListImageVersionsCallback} callback Node-style callback called with the error, if any, and ListImageVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ImageVersions.prototype.listImageVersions = function listImageVersions(request, callback) { + return this.rpcCall(listImageVersions, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest, $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse, request, callback); + }, "name", { value: "ListImageVersions" }); - return AllowedIpRange; - })(); + /** + * Calls ListImageVersions. + * @function listImageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersions + * @instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} request ListImageVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return WebServerNetworkAccessControl; + return ImageVersions; })(); - v1beta1.SoftwareConfig = (function() { + v1.ListImageVersionsRequest = (function() { /** - * Properties of a SoftwareConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface ISoftwareConfig - * @property {string|null} [imageVersion] SoftwareConfig imageVersion - * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides - * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages - * @property {Object.|null} [envVariables] SoftwareConfig envVariables - * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion + * Properties of a ListImageVersionsRequest. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IListImageVersionsRequest + * @property {string|null} [parent] ListImageVersionsRequest parent + * @property {number|null} [pageSize] ListImageVersionsRequest pageSize + * @property {string|null} [pageToken] ListImageVersionsRequest pageToken + * @property {boolean|null} [includePastReleases] ListImageVersionsRequest includePastReleases */ /** - * Constructs a new SoftwareConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a SoftwareConfig. - * @implements ISoftwareConfig + * Constructs a new ListImageVersionsRequest. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a ListImageVersionsRequest. + * @implements IListImageVersionsRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set */ - function SoftwareConfig(properties) { - this.airflowConfigOverrides = {}; - this.pypiPackages = {}; - this.envVariables = {}; + function ListImageVersionsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10084,191 +9732,117 @@ } /** - * SoftwareConfig imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.imageVersion = ""; - - /** - * SoftwareConfig airflowConfigOverrides. - * @member {Object.} airflowConfigOverrides - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * ListImageVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; + ListImageVersionsRequest.prototype.parent = ""; /** - * SoftwareConfig pypiPackages. - * @member {Object.} pypiPackages - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * ListImageVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - SoftwareConfig.prototype.pypiPackages = $util.emptyObject; + ListImageVersionsRequest.prototype.pageSize = 0; /** - * SoftwareConfig envVariables. - * @member {Object.} envVariables - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * ListImageVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - SoftwareConfig.prototype.envVariables = $util.emptyObject; + ListImageVersionsRequest.prototype.pageToken = ""; /** - * SoftwareConfig pythonVersion. - * @member {string} pythonVersion - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * ListImageVersionsRequest includePastReleases. + * @member {boolean} includePastReleases + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance */ - SoftwareConfig.prototype.pythonVersion = ""; + ListImageVersionsRequest.prototype.includePastReleases = false; /** - * Creates a new SoftwareConfig instance using the specified properties. + * Creates a new ListImageVersionsRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest instance */ - SoftwareConfig.create = function create(properties) { - return new SoftwareConfig(properties); + ListImageVersionsRequest.create = function create(properties) { + return new ListImageVersionsRequest(properties); }; /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encode = function encode(message, writer) { + ListImageVersionsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); - if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) - for (var keys = Object.keys(message.airflowConfigOverrides), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.airflowConfigOverrides[keys[i]]).ldelim(); - if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) - for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); - if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) - for (var keys = Object.keys(message.envVariables), 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.envVariables[keys[i]]).ldelim(); - if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); + 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.includePastReleases != null && Object.hasOwnProperty.call(message, "includePastReleases")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.includePastReleases); return writer; }; /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * Encodes the specified ListImageVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsRequest} message ListImageVersionsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListImageVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decode = function decode(reader, length) { + ListImageVersionsRequest.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.orchestration.airflow.service.v1beta1.SoftwareConfig(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.imageVersion = reader.string(); + message.parent = reader.string(); break; } case 2: { - if (message.airflowConfigOverrides === $util.emptyObject) - message.airflowConfigOverrides = {}; - 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.airflowConfigOverrides[key] = value; + message.pageSize = reader.int32(); break; } case 3: { - if (message.pypiPackages === $util.emptyObject) - message.pypiPackages = {}; - 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.pypiPackages[key] = value; + message.pageToken = reader.string(); break; } case 4: { - if (message.envVariables === $util.emptyObject) - message.envVariables = {}; - 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.envVariables[key] = value; - break; - } - case 6: { - message.pythonVersion = reader.string(); + message.includePastReleases = reader.bool(); break; } default: @@ -10280,201 +9854,149 @@ }; /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * Decodes a ListImageVersionsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + ListImageVersionsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SoftwareConfig message. + * Verifies a ListImageVersionsRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SoftwareConfig.verify = function verify(message) { + ListImageVersionsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - if (!$util.isString(message.imageVersion)) - return "imageVersion: string expected"; - if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { - if (!$util.isObject(message.airflowConfigOverrides)) - return "airflowConfigOverrides: object expected"; - var key = Object.keys(message.airflowConfigOverrides); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.airflowConfigOverrides[key[i]])) - return "airflowConfigOverrides: string{k:string} expected"; - } - if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { - if (!$util.isObject(message.pypiPackages)) - return "pypiPackages: object expected"; - var key = Object.keys(message.pypiPackages); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.pypiPackages[key[i]])) - return "pypiPackages: string{k:string} expected"; - } - if (message.envVariables != null && message.hasOwnProperty("envVariables")) { - if (!$util.isObject(message.envVariables)) - return "envVariables: object expected"; - var key = Object.keys(message.envVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.envVariables[key[i]])) - return "envVariables: string{k:string} expected"; - } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - if (!$util.isString(message.pythonVersion)) - return "pythonVersion: string 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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) + if (typeof message.includePastReleases !== "boolean") + return "includePastReleases: boolean expected"; return null; }; /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListImageVersionsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} ListImageVersionsRequest */ - SoftwareConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig) + ListImageVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig(); - if (object.imageVersion != null) - message.imageVersion = String(object.imageVersion); - if (object.airflowConfigOverrides) { - if (typeof object.airflowConfigOverrides !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.airflowConfigOverrides: object expected"); - message.airflowConfigOverrides = {}; - for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) - message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); - } - if (object.pypiPackages) { - if (typeof object.pypiPackages !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.pypiPackages: object expected"); - message.pypiPackages = {}; - for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) - message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); - } - if (object.envVariables) { - if (typeof object.envVariables !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.envVariables: object expected"); - message.envVariables = {}; - for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) - message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); - } - if (object.pythonVersion != null) - message.pythonVersion = String(object.pythonVersion); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest(); + 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.includePastReleases != null) + message.includePastReleases = Boolean(object.includePastReleases); return message; }; /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListImageVersionsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} message SoftwareConfig + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest} message ListImageVersionsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SoftwareConfig.toObject = function toObject(message, options) { + ListImageVersionsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.airflowConfigOverrides = {}; - object.pypiPackages = {}; - object.envVariables = {}; - } if (options.defaults) { - object.imageVersion = ""; - object.pythonVersion = ""; - } - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - object.imageVersion = message.imageVersion; - var keys2; - if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { - object.airflowConfigOverrides = {}; - for (var j = 0; j < keys2.length; ++j) - object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; - } - if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { - object.pypiPackages = {}; - for (var j = 0; j < keys2.length; ++j) - object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; - } - if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { - object.envVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.includePastReleases = false; } - if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) - object.pythonVersion = message.pythonVersion; - return object; - }; - - /** - * Converts this SoftwareConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + 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.includePastReleases != null && message.hasOwnProperty("includePastReleases")) + object.includePastReleases = message.includePastReleases; + return object; + }; + + /** + * Converts this ListImageVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @instance * @returns {Object.} JSON object */ - SoftwareConfig.prototype.toJSON = function toJSON() { + ListImageVersionsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SoftwareConfig + * Gets the default type url for ListImageVersionsRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListImageVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsRequest"; }; - return SoftwareConfig; + return ListImageVersionsRequest; })(); - v1beta1.IPAllocationPolicy = (function() { + v1.ListImageVersionsResponse = (function() { /** - * Properties of a IPAllocationPolicy. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IIPAllocationPolicy - * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases - * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName - * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName - * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock - * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock + * Properties of a ListImageVersionsResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IListImageVersionsResponse + * @property {Array.|null} [imageVersions] ListImageVersionsResponse imageVersions + * @property {string|null} [nextPageToken] ListImageVersionsResponse nextPageToken */ /** - * Constructs a new IPAllocationPolicy. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a IPAllocationPolicy. - * @implements IIPAllocationPolicy + * Constructs a new ListImageVersionsResponse. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents a ListImageVersionsResponse. + * @implements IListImageVersionsResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set */ - function IPAllocationPolicy(properties) { + function ListImageVersionsResponse(properties) { + this.imageVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10482,131 +10004,92 @@ } /** - * IPAllocationPolicy useIpAliases. - * @member {boolean} useIpAliases - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.useIpAliases = false; - - /** - * IPAllocationPolicy clusterSecondaryRangeName. - * @member {string} clusterSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.clusterSecondaryRangeName = ""; - - /** - * IPAllocationPolicy servicesSecondaryRangeName. - * @member {string} servicesSecondaryRangeName - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy - * @instance - */ - IPAllocationPolicy.prototype.servicesSecondaryRangeName = ""; - - /** - * IPAllocationPolicy clusterIpv4CidrBlock. - * @member {string} clusterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * ListImageVersionsResponse imageVersions. + * @member {Array.} imageVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @instance */ - IPAllocationPolicy.prototype.clusterIpv4CidrBlock = ""; + ListImageVersionsResponse.prototype.imageVersions = $util.emptyArray; /** - * IPAllocationPolicy servicesIpv4CidrBlock. - * @member {string} servicesIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * ListImageVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @instance */ - IPAllocationPolicy.prototype.servicesIpv4CidrBlock = ""; + ListImageVersionsResponse.prototype.nextPageToken = ""; /** - * Creates a new IPAllocationPolicy instance using the specified properties. + * Creates a new ListImageVersionsResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy instance + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse instance */ - IPAllocationPolicy.create = function create(properties) { - return new IPAllocationPolicy(properties); + ListImageVersionsResponse.create = function create(properties) { + return new ListImageVersionsResponse(properties); }; /** - * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * Encodes the specified ListImageVersionsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.encode = function encode(message, writer) { + ListImageVersionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); - if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); - if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); - if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); - if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); + if (message.imageVersions != null && message.imageVersions.length) + for (var i = 0; i < message.imageVersions.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.encode(message.imageVersions[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; }; /** - * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * Encodes the specified ListImageVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IListImageVersionsResponse} message ListImageVersionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + ListImageVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * Decodes a ListImageVersionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decode = function decode(reader, length) { + ListImageVersionsResponse.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.orchestration.airflow.service.v1beta1.IPAllocationPolicy(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.useIpAliases = reader.bool(); + if (!(message.imageVersions && message.imageVersions.length)) + message.imageVersions = []; + message.imageVersions.push($root.google.cloud.orchestration.airflow.service.v1.ImageVersion.decode(reader, reader.uint32())); break; } case 2: { - message.clusterSecondaryRangeName = reader.string(); - break; - } - case 3: { - message.servicesSecondaryRangeName = reader.string(); - break; - } - case 4: { - message.clusterIpv4CidrBlock = reader.string(); - break; - } - case 5: { - message.servicesIpv4CidrBlock = reader.string(); + message.nextPageToken = reader.string(); break; } default: @@ -10618,166 +10101,154 @@ }; /** - * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * Decodes a ListImageVersionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + ListImageVersionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a IPAllocationPolicy message. + * Verifies a ListImageVersionsResponse message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IPAllocationPolicy.verify = function verify(message) { + ListImageVersionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - if (typeof message.useIpAliases !== "boolean") - return "useIpAliases: boolean expected"; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) - if (!$util.isString(message.clusterSecondaryRangeName)) - return "clusterSecondaryRangeName: string expected"; - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) - if (!$util.isString(message.servicesSecondaryRangeName)) - return "servicesSecondaryRangeName: string expected"; - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) - if (!$util.isString(message.clusterIpv4CidrBlock)) - return "clusterIpv4CidrBlock: string expected"; - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) - if (!$util.isString(message.servicesIpv4CidrBlock)) - return "servicesIpv4CidrBlock: string expected"; + if (message.imageVersions != null && message.hasOwnProperty("imageVersions")) { + if (!Array.isArray(message.imageVersions)) + return "imageVersions: array expected"; + for (var i = 0; i < message.imageVersions.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.verify(message.imageVersions[i]); + if (error) + return "imageVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a ListImageVersionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + * @returns {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} ListImageVersionsResponse */ - IPAllocationPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy) + ListImageVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy(); - if (object.useIpAliases != null) - message.useIpAliases = Boolean(object.useIpAliases); - if (object.clusterSecondaryRangeName != null) - message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); - if (object.servicesSecondaryRangeName != null) - message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); - if (object.clusterIpv4CidrBlock != null) - message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); - if (object.servicesIpv4CidrBlock != null) - message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse(); + if (object.imageVersions) { + if (!Array.isArray(object.imageVersions)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: array expected"); + message.imageVersions = []; + for (var i = 0; i < object.imageVersions.length; ++i) { + if (typeof object.imageVersions[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse.imageVersions: object expected"); + message.imageVersions[i] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.fromObject(object.imageVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * Creates a plain object from a ListImageVersionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} message IPAllocationPolicy + * @param {google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse} message ListImageVersionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IPAllocationPolicy.toObject = function toObject(message, options) { + ListImageVersionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.useIpAliases = false; - object.clusterSecondaryRangeName = ""; - object.servicesSecondaryRangeName = ""; - object.clusterIpv4CidrBlock = ""; - object.servicesIpv4CidrBlock = ""; - } - if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) - object.useIpAliases = message.useIpAliases; - if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) - object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; - if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) - object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; - if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) - object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; - if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) - object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; + if (options.arrays || options.defaults) + object.imageVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.imageVersions && message.imageVersions.length) { + object.imageVersions = []; + for (var j = 0; j < message.imageVersions.length; ++j) + object.imageVersions[j] = $root.google.cloud.orchestration.airflow.service.v1.ImageVersion.toObject(message.imageVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this IPAllocationPolicy to JSON. + * Converts this ListImageVersionsResponse to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @instance * @returns {Object.} JSON object */ - IPAllocationPolicy.prototype.toJSON = function toJSON() { + ListImageVersionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IPAllocationPolicy + * Gets the default type url for ListImageVersionsResponse * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListImageVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse"; }; - return IPAllocationPolicy; + return ListImageVersionsResponse; })(); - v1beta1.NodeConfig = (function() { + v1.ImageVersion = (function() { /** - * Properties of a NodeConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface INodeConfig - * @property {string|null} [location] NodeConfig location - * @property {string|null} [machineType] NodeConfig machineType - * @property {string|null} [network] NodeConfig network - * @property {string|null} [subnetwork] NodeConfig subnetwork - * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb - * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes - * @property {string|null} [serviceAccount] NodeConfig serviceAccount - * @property {Array.|null} [tags] NodeConfig tags - * @property {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy - * @property {number|null} [maxPodsPerNode] NodeConfig maxPodsPerNode + * Properties of an ImageVersion. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IImageVersion + * @property {string|null} [imageVersionId] ImageVersion imageVersionId + * @property {boolean|null} [isDefault] ImageVersion isDefault + * @property {Array.|null} [supportedPythonVersions] ImageVersion supportedPythonVersions + * @property {google.type.IDate|null} [releaseDate] ImageVersion releaseDate + * @property {boolean|null} [creationDisabled] ImageVersion creationDisabled + * @property {boolean|null} [upgradeDisabled] ImageVersion upgradeDisabled */ /** - * Constructs a new NodeConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a NodeConfig. - * @implements INodeConfig + * Constructs a new ImageVersion. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an ImageVersion. + * @implements IImageVersion * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set */ - function NodeConfig(properties) { - this.oauthScopes = []; - this.tags = []; + function ImageVersion(properties) { + this.supportedPythonVersions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10785,207 +10256,148 @@ } /** - * NodeConfig location. - * @member {string} location - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig - * @instance - */ - NodeConfig.prototype.location = ""; - - /** - * NodeConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig - * @instance - */ - NodeConfig.prototype.machineType = ""; - - /** - * NodeConfig network. - * @member {string} network - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig - * @instance - */ - NodeConfig.prototype.network = ""; - - /** - * NodeConfig subnetwork. - * @member {string} subnetwork - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig - * @instance - */ - NodeConfig.prototype.subnetwork = ""; - - /** - * NodeConfig diskSizeGb. - * @member {number} diskSizeGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion imageVersionId. + * @member {string} imageVersionId + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.diskSizeGb = 0; + ImageVersion.prototype.imageVersionId = ""; /** - * NodeConfig oauthScopes. - * @member {Array.} oauthScopes - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion isDefault. + * @member {boolean} isDefault + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.oauthScopes = $util.emptyArray; + ImageVersion.prototype.isDefault = false; /** - * NodeConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion supportedPythonVersions. + * @member {Array.} supportedPythonVersions + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.serviceAccount = ""; + ImageVersion.prototype.supportedPythonVersions = $util.emptyArray; /** - * NodeConfig tags. - * @member {Array.} tags - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion releaseDate. + * @member {google.type.IDate|null|undefined} releaseDate + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.tags = $util.emptyArray; + ImageVersion.prototype.releaseDate = null; /** - * NodeConfig ipAllocationPolicy. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion creationDisabled. + * @member {boolean} creationDisabled + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.ipAllocationPolicy = null; + ImageVersion.prototype.creationDisabled = false; /** - * NodeConfig maxPodsPerNode. - * @member {number} maxPodsPerNode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * ImageVersion upgradeDisabled. + * @member {boolean} upgradeDisabled + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance */ - NodeConfig.prototype.maxPodsPerNode = 0; + ImageVersion.prototype.upgradeDisabled = false; /** - * Creates a new NodeConfig instance using the specified properties. + * Creates a new ImageVersion instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion instance */ - NodeConfig.create = function create(properties) { - return new NodeConfig(properties); + ImageVersion.create = function create(properties) { + return new ImageVersion(properties); }; /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * Encodes the specified ImageVersion message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encode = function encode(message, writer) { + ImageVersion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); - if (message.oauthScopes != null && message.oauthScopes.length) - for (var i = 0; i < message.oauthScopes.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); - if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) - $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.maxPodsPerNode != null && Object.hasOwnProperty.call(message, "maxPodsPerNode")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.maxPodsPerNode); + if (message.imageVersionId != null && Object.hasOwnProperty.call(message, "imageVersionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersionId); + if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isDefault); + if (message.supportedPythonVersions != null && message.supportedPythonVersions.length) + for (var i = 0; i < message.supportedPythonVersions.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.supportedPythonVersions[i]); + if (message.releaseDate != null && Object.hasOwnProperty.call(message, "releaseDate")) + $root.google.type.Date.encode(message.releaseDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.creationDisabled != null && Object.hasOwnProperty.call(message, "creationDisabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.creationDisabled); + if (message.upgradeDisabled != null && Object.hasOwnProperty.call(message, "upgradeDisabled")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.upgradeDisabled); return writer; }; /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * Encodes the specified ImageVersion message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.ImageVersion.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig} message NodeConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IImageVersion} message ImageVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + ImageVersion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NodeConfig message from the specified reader or buffer. + * Decodes an ImageVersion message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decode = function decode(reader, length) { + ImageVersion.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.orchestration.airflow.service.v1beta1.NodeConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.location = reader.string(); + message.imageVersionId = reader.string(); break; } case 2: { - message.machineType = reader.string(); + message.isDefault = reader.bool(); break; } case 3: { - message.network = reader.string(); + if (!(message.supportedPythonVersions && message.supportedPythonVersions.length)) + message.supportedPythonVersions = []; + message.supportedPythonVersions.push(reader.string()); break; } case 4: { - message.subnetwork = reader.string(); + message.releaseDate = $root.google.type.Date.decode(reader, reader.uint32()); break; } case 5: { - message.diskSizeGb = reader.int32(); + message.creationDisabled = reader.bool(); break; } case 6: { - if (!(message.oauthScopes && message.oauthScopes.length)) - message.oauthScopes = []; - message.oauthScopes.push(reader.string()); - break; - } - case 7: { - message.serviceAccount = reader.string(); - break; - } - case 8: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 9: { - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.decode(reader, reader.uint32()); - break; - } - case 10: { - message.maxPodsPerNode = reader.int32(); + message.upgradeDisabled = reader.bool(); break; } default: @@ -10997,228 +10409,186 @@ }; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes an ImageVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decodeDelimited = function decodeDelimited(reader) { + ImageVersion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeConfig message. + * Verifies an ImageVersion message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeConfig.verify = function verify(message) { + ImageVersion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb)) - return "diskSizeGb: integer expected"; - if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { - if (!Array.isArray(message.oauthScopes)) - return "oauthScopes: array expected"; - for (var i = 0; i < message.oauthScopes.length; ++i) - if (!$util.isString(message.oauthScopes[i])) - return "oauthScopes: string[] expected"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.tags != null && message.hasOwnProperty("tags")) { - if (!Array.isArray(message.tags)) - return "tags: array expected"; - for (var i = 0; i < message.tags.length; ++i) - if (!$util.isString(message.tags[i])) - return "tags: string[] expected"; + if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) + if (!$util.isString(message.imageVersionId)) + return "imageVersionId: string expected"; + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + if (typeof message.isDefault !== "boolean") + return "isDefault: boolean expected"; + if (message.supportedPythonVersions != null && message.hasOwnProperty("supportedPythonVersions")) { + if (!Array.isArray(message.supportedPythonVersions)) + return "supportedPythonVersions: array expected"; + for (var i = 0; i < message.supportedPythonVersions.length; ++i) + if (!$util.isString(message.supportedPythonVersions[i])) + return "supportedPythonVersions: string[] expected"; } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify(message.ipAllocationPolicy); + if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) { + var error = $root.google.type.Date.verify(message.releaseDate); if (error) - return "ipAllocationPolicy." + error; + return "releaseDate." + error; } - if (message.maxPodsPerNode != null && message.hasOwnProperty("maxPodsPerNode")) - if (!$util.isInteger(message.maxPodsPerNode)) - return "maxPodsPerNode: integer expected"; + if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) + if (typeof message.creationDisabled !== "boolean") + return "creationDisabled: boolean expected"; + if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) + if (typeof message.upgradeDisabled !== "boolean") + return "upgradeDisabled: boolean expected"; return null; }; /** - * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates an ImageVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + * @returns {google.cloud.orchestration.airflow.service.v1.ImageVersion} ImageVersion */ - NodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig) + ImageVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.ImageVersion) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig(); - if (object.location != null) - message.location = String(object.location); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.diskSizeGb != null) - message.diskSizeGb = object.diskSizeGb | 0; - if (object.oauthScopes) { - if (!Array.isArray(object.oauthScopes)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.oauthScopes: array expected"); - message.oauthScopes = []; - for (var i = 0; i < object.oauthScopes.length; ++i) - message.oauthScopes[i] = String(object.oauthScopes[i]); - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); + var message = new $root.google.cloud.orchestration.airflow.service.v1.ImageVersion(); + if (object.imageVersionId != null) + message.imageVersionId = String(object.imageVersionId); + if (object.isDefault != null) + message.isDefault = Boolean(object.isDefault); + if (object.supportedPythonVersions) { + if (!Array.isArray(object.supportedPythonVersions)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.supportedPythonVersions: array expected"); + message.supportedPythonVersions = []; + for (var i = 0; i < object.supportedPythonVersions.length; ++i) + message.supportedPythonVersions[i] = String(object.supportedPythonVersions[i]); } - if (object.ipAllocationPolicy != null) { - if (typeof object.ipAllocationPolicy !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.ipAllocationPolicy: object expected"); - message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); + if (object.releaseDate != null) { + if (typeof object.releaseDate !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.ImageVersion.releaseDate: object expected"); + message.releaseDate = $root.google.type.Date.fromObject(object.releaseDate); } - if (object.maxPodsPerNode != null) - message.maxPodsPerNode = object.maxPodsPerNode | 0; + if (object.creationDisabled != null) + message.creationDisabled = Boolean(object.creationDisabled); + if (object.upgradeDisabled != null) + message.upgradeDisabled = Boolean(object.upgradeDisabled); return message; }; /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * Creates a plain object from an ImageVersion message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} message NodeConfig + * @param {google.cloud.orchestration.airflow.service.v1.ImageVersion} message ImageVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeConfig.toObject = function toObject(message, options) { + ImageVersion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.oauthScopes = []; - object.tags = []; - } + if (options.arrays || options.defaults) + object.supportedPythonVersions = []; if (options.defaults) { - object.location = ""; - object.machineType = ""; - object.network = ""; - object.subnetwork = ""; - object.diskSizeGb = 0; - object.serviceAccount = ""; - object.ipAllocationPolicy = null; - object.maxPodsPerNode = 0; - } - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - object.diskSizeGb = message.diskSizeGb; - if (message.oauthScopes && message.oauthScopes.length) { - object.oauthScopes = []; - for (var j = 0; j < message.oauthScopes.length; ++j) - object.oauthScopes[j] = message.oauthScopes[j]; + object.imageVersionId = ""; + object.isDefault = false; + object.releaseDate = null; + object.creationDisabled = false; + object.upgradeDisabled = false; } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; + if (message.imageVersionId != null && message.hasOwnProperty("imageVersionId")) + object.imageVersionId = message.imageVersionId; + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + object.isDefault = message.isDefault; + if (message.supportedPythonVersions && message.supportedPythonVersions.length) { + object.supportedPythonVersions = []; + for (var j = 0; j < message.supportedPythonVersions.length; ++j) + object.supportedPythonVersions[j] = message.supportedPythonVersions[j]; } - if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) - object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); - if (message.maxPodsPerNode != null && message.hasOwnProperty("maxPodsPerNode")) - object.maxPodsPerNode = message.maxPodsPerNode; + if (message.releaseDate != null && message.hasOwnProperty("releaseDate")) + object.releaseDate = $root.google.type.Date.toObject(message.releaseDate, options); + if (message.creationDisabled != null && message.hasOwnProperty("creationDisabled")) + object.creationDisabled = message.creationDisabled; + if (message.upgradeDisabled != null && message.hasOwnProperty("upgradeDisabled")) + object.upgradeDisabled = message.upgradeDisabled; return object; }; /** - * Converts this NodeConfig to JSON. + * Converts this ImageVersion to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @instance * @returns {Object.} JSON object */ - NodeConfig.prototype.toJSON = function toJSON() { + ImageVersion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for NodeConfig + * Gets the default type url for ImageVersion * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1.ImageVersion * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImageVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.NodeConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.ImageVersion"; }; - return NodeConfig; + return ImageVersion; })(); - v1beta1.PrivateClusterConfig = (function() { + v1.OperationMetadata = (function() { /** - * Properties of a PrivateClusterConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IPrivateClusterConfig - * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint - * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock - * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange + * Properties of an OperationMetadata. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @interface IOperationMetadata + * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State|null} [state] OperationMetadata state + * @property {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type|null} [operationType] OperationMetadata operationType + * @property {string|null} [resource] OperationMetadata resource + * @property {string|null} [resourceUuid] OperationMetadata resourceUuid + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime */ /** - * Constructs a new PrivateClusterConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a PrivateClusterConfig. - * @implements IPrivateClusterConfig + * Constructs a new OperationMetadata. + * @memberof google.cloud.orchestration.airflow.service.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set */ - function PrivateClusterConfig(properties) { + function OperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11226,103 +10596,145 @@ } /** - * PrivateClusterConfig enablePrivateEndpoint. - * @member {boolean} enablePrivateEndpoint - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig - * @instance - */ - PrivateClusterConfig.prototype.enablePrivateEndpoint = false; + * OperationMetadata state. + * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.State} state + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.state = 0; /** - * PrivateClusterConfig masterIpv4CidrBlock. - * @member {string} masterIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * OperationMetadata operationType. + * @member {google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type} operationType + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @instance */ - PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; + OperationMetadata.prototype.operationType = 0; /** - * PrivateClusterConfig masterIpv4ReservedRange. - * @member {string} masterIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * OperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @instance */ - PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; + OperationMetadata.prototype.resource = ""; /** - * Creates a new PrivateClusterConfig instance using the specified properties. + * OperationMetadata resourceUuid. + * @member {string} resourceUuid + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.resourceUuid = ""; + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * Creates a new OperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig instance + * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata instance */ - PrivateClusterConfig.create = function create(properties) { - return new PrivateClusterConfig(properties); + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); }; /** - * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encode = function encode(message, writer) { + OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); - if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); - if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operationType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.resourceUuid != null && Object.hasOwnProperty.call(message, "resourceUuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUuid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1.OperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1.IOperationMetadata} message OperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * Decodes an OperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decode = function decode(reader, length) { + OperationMetadata.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.orchestration.airflow.service.v1beta1.PrivateClusterConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.enablePrivateEndpoint = reader.bool(); + message.state = reader.int32(); break; } case 2: { - message.masterIpv4CidrBlock = reader.string(); + message.operationType = reader.int32(); break; } case 3: { - message.masterIpv4ReservedRange = reader.string(); + message.resource = reader.string(); + break; + } + case 4: { + message.resourceUuid = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -11334,486 +10746,647 @@ }; /** - * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrivateClusterConfig message. + * Verifies an OperationMetadata message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrivateClusterConfig.verify = function verify(message) { + OperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - if (typeof message.enablePrivateEndpoint !== "boolean") - return "enablePrivateEndpoint: boolean expected"; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - if (!$util.isString(message.masterIpv4CidrBlock)) - return "masterIpv4CidrBlock: string expected"; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - if (!$util.isString(message.masterIpv4ReservedRange)) - return "masterIpv4ReservedRange: 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 3: + case 4: + break; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) + if (!$util.isString(message.resourceUuid)) + return "resourceUuid: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + 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 PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + * @returns {google.cloud.orchestration.airflow.service.v1.OperationMetadata} OperationMetadata */ - PrivateClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig) + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig(); - if (object.enablePrivateEndpoint != null) - message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); - if (object.masterIpv4CidrBlock != null) - message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); - if (object.masterIpv4ReservedRange != null) - message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); - return message; - }; - - /** - * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} message PrivateClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrivateClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enablePrivateEndpoint = false; - object.masterIpv4CidrBlock = ""; - object.masterIpv4ReservedRange = ""; + var message = new $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "SUCCESSFUL": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; } - if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) - object.enablePrivateEndpoint = message.enablePrivateEndpoint; - if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) - object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; - if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) - object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "CREATE": + case 1: + message.operationType = 1; + break; + case "DELETE": + case 2: + message.operationType = 2; + break; + case "UPDATE": + case 3: + message.operationType = 3; + break; + case "CHECK": + case 4: + message.operationType = 4; + break; + case "SAVE_SNAPSHOT": + case 5: + message.operationType = 5; + break; + case "LOAD_SNAPSHOT": + case 6: + message.operationType = 6; + break; + } + if (object.resource != null) + message.resource = String(object.resource); + if (object.resourceUuid != null) + message.resourceUuid = String(object.resourceUuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata + * @static + * @param {google.cloud.orchestration.airflow.service.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.operationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.resource = ""; + object.resourceUuid = ""; + object.createTime = null; + object.endTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.State[message.state] : message.state; + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] === undefined ? message.operationType : $root.google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type[message.operationType] : message.operationType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.resourceUuid != null && message.hasOwnProperty("resourceUuid")) + object.resourceUuid = message.resourceUuid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); return object; }; /** - * Converts this PrivateClusterConfig to JSON. + * Converts this OperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @instance * @returns {Object.} JSON object */ - PrivateClusterConfig.prototype.toJSON = function toJSON() { + OperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PrivateClusterConfig + * Gets the default type url for OperationMetadata * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1.OperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1.OperationMetadata"; }; - return PrivateClusterConfig; - })(); - - v1beta1.PrivateEnvironmentConfig = (function() { + /** + * State enum. + * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} SUCCESSFUL=3 SUCCESSFUL value + * @property {number} FAILED=4 FAILED value + */ + OperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values["SUCCESSFUL"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); /** - * Properties of a PrivateEnvironmentConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IPrivateEnvironmentConfig - * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment - * @property {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig - * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock - * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock - * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange - * @property {string|null} [cloudComposerNetworkIpv4CidrBlock] PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock - * @property {string|null} [cloudComposerNetworkIpv4ReservedRange] PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange + * Type enum. + * @name google.cloud.orchestration.airflow.service.v1.OperationMetadata.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} DELETE=2 DELETE value + * @property {number} UPDATE=3 UPDATE value + * @property {number} CHECK=4 CHECK value + * @property {number} SAVE_SNAPSHOT=5 SAVE_SNAPSHOT value + * @property {number} LOAD_SNAPSHOT=6 LOAD_SNAPSHOT value */ + OperationMetadata.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "DELETE"] = 2; + values[valuesById[3] = "UPDATE"] = 3; + values[valuesById[4] = "CHECK"] = 4; + values[valuesById[5] = "SAVE_SNAPSHOT"] = 5; + values[valuesById[6] = "LOAD_SNAPSHOT"] = 6; + return values; + })(); + + return OperationMetadata; + })(); + + return v1; + })(); + + service.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.orchestration.airflow.service + * @namespace + */ + var v1beta1 = {}; + + v1beta1.Environments = (function() { /** - * Constructs a new PrivateEnvironmentConfig. + * Constructs a new Environments service. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a PrivateEnvironmentConfig. - * @implements IPrivateEnvironmentConfig + * @classdesc Represents an Environments + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @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 PrivateEnvironmentConfig(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]]; + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - /** - * PrivateEnvironmentConfig enablePrivateEnvironment. - * @member {boolean} enablePrivateEnvironment - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @instance - */ - PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; /** - * PrivateEnvironmentConfig privateClusterConfig. - * @member {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null|undefined} privateClusterConfig - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @instance + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @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 {Environments} RPC service. Useful where requests and/or responses are streamed. */ - PrivateEnvironmentConfig.prototype.privateClusterConfig = null; + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * PrivateEnvironmentConfig webServerIpv4CidrBlock. - * @member {string} webServerIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @instance + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|createEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef CreateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; /** - * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. - * @member {string} cloudSqlIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CreateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; + Object.defineProperty(Environments.prototype.createEnvironment = function createEnvironment(request, callback) { + return this.rpcCall(createEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateEnvironment" }); /** - * PrivateEnvironmentConfig webServerIpv4ReservedRange. - * @member {string} webServerIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * Calls CreateEnvironment. + * @function createEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} request CreateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; /** - * PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. - * @member {string} cloudComposerNetworkIpv4CidrBlock - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @instance + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|getEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef GetEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environment} [response] Environment */ - PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4CidrBlock = ""; /** - * PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. - * @member {string} cloudComposerNetworkIpv4ReservedRange - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.GetEnvironmentCallback} callback Node-style callback called with the error, if any, and Environment + * @returns {undefined} + * @variation 1 */ - PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4ReservedRange = ""; + Object.defineProperty(Environments.prototype.getEnvironment = function getEnvironment(request, callback) { + return this.rpcCall(getEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.Environment, request, callback); + }, "name", { value: "GetEnvironment" }); /** - * Creates a new PrivateEnvironmentConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance + * Calls GetEnvironment. + * @function getEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} request GetEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PrivateEnvironmentConfig.create = function create(properties) { - return new PrivateEnvironmentConfig(properties); - }; /** - * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|listEnvironments}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse */ - PrivateEnvironmentConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); - if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) - $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); - if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); - if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); - if (message.cloudComposerNetworkIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4CidrBlock")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudComposerNetworkIpv4CidrBlock); - if (message.cloudComposerNetworkIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4ReservedRange")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudComposerNetworkIpv4ReservedRange); - return writer; - }; /** - * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 */ - PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest, $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PrivateEnvironmentConfig.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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.enablePrivateEnvironment = reader.bool(); - break; - } - case 2: { - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.webServerIpv4CidrBlock = reader.string(); - break; - } - case 4: { - message.cloudSqlIpv4CidrBlock = reader.string(); - break; - } - case 5: { - message.webServerIpv4ReservedRange = reader.string(); - break; - } - case 7: { - message.cloudComposerNetworkIpv4CidrBlock = reader.string(); - break; - } - case 8: { - message.cloudComposerNetworkIpv4ReservedRange = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|updateEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef UpdateEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a PrivateEnvironmentConfig message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.UpdateEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PrivateEnvironmentConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - if (typeof message.enablePrivateEnvironment !== "boolean") - return "enablePrivateEnvironment: boolean expected"; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify(message.privateClusterConfig); - if (error) - return "privateClusterConfig." + error; - } - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - if (!$util.isString(message.webServerIpv4CidrBlock)) - return "webServerIpv4CidrBlock: string expected"; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - if (!$util.isString(message.cloudSqlIpv4CidrBlock)) - return "cloudSqlIpv4CidrBlock: string expected"; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - if (!$util.isString(message.webServerIpv4ReservedRange)) - return "webServerIpv4ReservedRange: string expected"; - if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) - if (!$util.isString(message.cloudComposerNetworkIpv4CidrBlock)) - return "cloudComposerNetworkIpv4CidrBlock: string expected"; - if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) - if (!$util.isString(message.cloudComposerNetworkIpv4ReservedRange)) - return "cloudComposerNetworkIpv4ReservedRange: string expected"; - return null; - }; + Object.defineProperty(Environments.prototype.updateEnvironment = function updateEnvironment(request, callback) { + return this.rpcCall(updateEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateEnvironment" }); /** - * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * Calls UpdateEnvironment. + * @function updateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} request UpdateEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PrivateEnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig(); - if (object.enablePrivateEnvironment != null) - message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); - if (object.privateClusterConfig != null) { - if (typeof object.privateClusterConfig !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); - message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.fromObject(object.privateClusterConfig); - } - if (object.webServerIpv4CidrBlock != null) - message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); - if (object.cloudSqlIpv4CidrBlock != null) - message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); - if (object.webServerIpv4ReservedRange != null) - message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); - if (object.cloudComposerNetworkIpv4CidrBlock != null) - message.cloudComposerNetworkIpv4CidrBlock = String(object.cloudComposerNetworkIpv4CidrBlock); - if (object.cloudComposerNetworkIpv4ReservedRange != null) - message.cloudComposerNetworkIpv4ReservedRange = String(object.cloudComposerNetworkIpv4ReservedRange); - return message; - }; /** - * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|deleteEnvironment}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef DeleteEnvironmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - PrivateEnvironmentConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enablePrivateEnvironment = false; - object.privateClusterConfig = null; - object.webServerIpv4CidrBlock = ""; - object.cloudSqlIpv4CidrBlock = ""; - object.webServerIpv4ReservedRange = ""; - object.cloudComposerNetworkIpv4CidrBlock = ""; - object.cloudComposerNetworkIpv4ReservedRange = ""; - } - if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) - object.enablePrivateEnvironment = message.enablePrivateEnvironment; - if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) - object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); - if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) - object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; - if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) - object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; - if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) - object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; - if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) - object.cloudComposerNetworkIpv4CidrBlock = message.cloudComposerNetworkIpv4CidrBlock; - if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) - object.cloudComposerNetworkIpv4ReservedRange = message.cloudComposerNetworkIpv4ReservedRange; - return object; - }; /** - * Converts this PrivateEnvironmentConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments * @instance - * @returns {Object.} JSON object + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.DeleteEnvironmentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(Environments.prototype.deleteEnvironment = function deleteEnvironment(request, callback) { + return this.rpcCall(deleteEnvironment, $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteEnvironment" }); /** - * Gets the default type url for PrivateEnvironmentConfig - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteEnvironment. + * @function deleteEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} request DeleteEnvironmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig"; - }; - return PrivateEnvironmentConfig; + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|restartWebServer}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef RestartWebServerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartWebServer. + * @function restartWebServer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.RestartWebServerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.restartWebServer = function restartWebServer(request, callback) { + return this.rpcCall(restartWebServer, $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartWebServer" }); + + /** + * Calls RestartWebServer. + * @function restartWebServer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} request RestartWebServerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|checkUpgrade}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef CheckUpgradeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CheckUpgrade. + * @function checkUpgrade + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.CheckUpgradeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.checkUpgrade = function checkUpgrade(request, callback) { + return this.rpcCall(checkUpgrade, $root.google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CheckUpgrade" }); + + /** + * Calls CheckUpgrade. + * @function checkUpgrade + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICheckUpgradeRequest} request CheckUpgradeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|saveSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef SaveSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.saveSnapshot = function saveSnapshot(request, callback) { + return this.rpcCall(saveSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SaveSnapshot" }); + + /** + * Calls SaveSnapshot. + * @function saveSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} request SaveSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.orchestration.airflow.service.v1beta1.Environments|loadSnapshot}. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @typedef LoadSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @param {google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.loadSnapshot = function loadSnapshot(request, callback) { + return this.rpcCall(loadSnapshot, $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "LoadSnapshot" }); + + /** + * Calls LoadSnapshot. + * @function loadSnapshot + * @memberof google.cloud.orchestration.airflow.service.v1beta1.Environments + * @instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} request LoadSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Environments; })(); - v1beta1.DatabaseConfig = (function() { + v1beta1.CreateEnvironmentRequest = (function() { /** - * Properties of a DatabaseConfig. + * Properties of a CreateEnvironmentRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IDatabaseConfig - * @property {string|null} [machineType] DatabaseConfig machineType + * @interface ICreateEnvironmentRequest + * @property {string|null} [parent] CreateEnvironmentRequest parent + * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] CreateEnvironmentRequest environment */ /** - * Constructs a new DatabaseConfig. + * Constructs a new CreateEnvironmentRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a DatabaseConfig. - * @implements IDatabaseConfig + * @classdesc Represents a CreateEnvironmentRequest. + * @implements ICreateEnvironmentRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set */ - function DatabaseConfig(properties) { + function CreateEnvironmentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11821,75 +11394,89 @@ } /** - * DatabaseConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * CreateEnvironmentRequest parent. + * @member {string} parent + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @instance */ - DatabaseConfig.prototype.machineType = ""; + CreateEnvironmentRequest.prototype.parent = ""; /** - * Creates a new DatabaseConfig instance using the specified properties. + * CreateEnvironmentRequest environment. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest + * @instance + */ + CreateEnvironmentRequest.prototype.environment = null; + + /** + * Creates a new CreateEnvironmentRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest instance */ - DatabaseConfig.create = function create(properties) { - return new DatabaseConfig(properties); + CreateEnvironmentRequest.create = function create(properties) { + return new CreateEnvironmentRequest(properties); }; /** - * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * Encodes the specified CreateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encode = function encode(message, writer) { + CreateEnvironmentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * Encodes the specified CreateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICreateEnvironmentRequest} message CreateEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { + CreateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer. + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decode = function decode(reader, length) { + CreateEnvironmentRequest.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.orchestration.airflow.service.v1beta1.DatabaseConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); break; } default: @@ -11901,122 +11488,136 @@ }; /** - * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateEnvironmentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { + CreateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DatabaseConfig message. + * Verifies a CreateEnvironmentRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DatabaseConfig.verify = function verify(message) { + CreateEnvironmentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } return null; }; /** - * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} CreateEnvironmentRequest */ - DatabaseConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig) + CreateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); + } return message; }; /** - * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * Creates a plain object from a CreateEnvironmentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} message DatabaseConfig + * @param {google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest} message CreateEnvironmentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseConfig.toObject = function toObject(message, options) { + CreateEnvironmentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; + if (options.defaults) { + object.parent = ""; + object.environment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); return object; }; /** - * Converts this DatabaseConfig to JSON. + * Converts this CreateEnvironmentRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @instance * @returns {Object.} JSON object */ - DatabaseConfig.prototype.toJSON = function toJSON() { + CreateEnvironmentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DatabaseConfig + * Gets the default type url for CreateEnvironmentRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.CreateEnvironmentRequest"; }; - return DatabaseConfig; + return CreateEnvironmentRequest; })(); - v1beta1.WebServerConfig = (function() { + v1beta1.GetEnvironmentRequest = (function() { /** - * Properties of a WebServerConfig. + * Properties of a GetEnvironmentRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IWebServerConfig - * @property {string|null} [machineType] WebServerConfig machineType + * @interface IGetEnvironmentRequest + * @property {string|null} [name] GetEnvironmentRequest name */ /** - * Constructs a new WebServerConfig. + * Constructs a new GetEnvironmentRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a WebServerConfig. - * @implements IWebServerConfig + * @classdesc Represents a GetEnvironmentRequest. + * @implements IGetEnvironmentRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set */ - function WebServerConfig(properties) { + function GetEnvironmentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12024,75 +11625,75 @@ } /** - * WebServerConfig machineType. - * @member {string} machineType - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * GetEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @instance */ - WebServerConfig.prototype.machineType = ""; + GetEnvironmentRequest.prototype.name = ""; /** - * Creates a new WebServerConfig instance using the specified properties. + * Creates a new GetEnvironmentRequest instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest instance */ - WebServerConfig.create = function create(properties) { - return new WebServerConfig(properties); + GetEnvironmentRequest.create = function create(properties) { + return new GetEnvironmentRequest(properties); }; /** - * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * Encodes the specified GetEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encode = function encode(message, writer) { + GetEnvironmentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * Encodes the specified GetEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IGetEnvironmentRequest} message GetEnvironmentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + GetEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebServerConfig message from the specified reader or buffer. + * Decodes a GetEnvironmentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decode = function decode(reader, length) { + GetEnvironmentRequest.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.orchestration.airflow.service.v1beta1.WebServerConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); + message.name = reader.string(); break; } default: @@ -12104,122 +11705,124 @@ }; /** - * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * Decodes a GetEnvironmentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebServerConfig.decodeDelimited = function decodeDelimited(reader) { + GetEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebServerConfig message. + * Verifies a GetEnvironmentRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebServerConfig.verify = function verify(message) { + GetEnvironmentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a GetEnvironmentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} GetEnvironmentRequest */ - WebServerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig) + GetEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * Creates a plain object from a GetEnvironmentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} message WebServerConfig + * @param {google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest} message GetEnvironmentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebServerConfig.toObject = function toObject(message, options) { + GetEnvironmentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.machineType = ""; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this WebServerConfig to JSON. + * Converts this GetEnvironmentRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @instance * @returns {Object.} JSON object */ - WebServerConfig.prototype.toJSON = function toJSON() { + GetEnvironmentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WebServerConfig + * Gets the default type url for GetEnvironmentRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.GetEnvironmentRequest"; }; - return WebServerConfig; + return GetEnvironmentRequest; })(); - v1beta1.EncryptionConfig = (function() { + v1beta1.ListEnvironmentsRequest = (function() { /** - * Properties of an EncryptionConfig. + * Properties of a ListEnvironmentsRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken */ /** - * Constructs a new EncryptionConfig. + * Constructs a new ListEnvironmentsRequest. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set */ - function EncryptionConfig(properties) { + function ListEnvironmentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12227,75 +11830,103 @@ } /** - * EncryptionConfig kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance */ - EncryptionConfig.prototype.kmsKeyName = ""; + ListEnvironmentsRequest.prototype.parent = ""; /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig instance + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @instance */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); }; /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encode = function encode(message, writer) { + ListEnvironmentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + 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); return writer; }; /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decode = function decode(reader, length) { + ListEnvironmentsRequest.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.orchestration.airflow.service.v1beta1.EncryptionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.kmsKeyName = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -12307,124 +11938,141 @@ }; /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EncryptionConfig message. + * Verifies a ListEnvironmentsRequest message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EncryptionConfig.verify = function verify(message) { + ListEnvironmentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string 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"; return null; }; /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} ListEnvironmentsRequest */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig) + ListEnvironmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest(); + 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); return message; }; /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} message EncryptionConfig + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + ListEnvironmentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; return object; }; /** - * Converts this EncryptionConfig to JSON. + * Converts this ListEnvironmentsRequest to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @instance * @returns {Object.} JSON object */ - EncryptionConfig.prototype.toJSON = function toJSON() { + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EncryptionConfig + * Gets the default type url for ListEnvironmentsRequest * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListEnvironmentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsRequest"; }; - return EncryptionConfig; + return ListEnvironmentsRequest; })(); - v1beta1.MaintenanceWindow = (function() { + v1beta1.ListEnvironmentsResponse = (function() { /** - * Properties of a MaintenanceWindow. + * Properties of a ListEnvironmentsResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IMaintenanceWindow - * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceWindow startTime - * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceWindow endTime - * @property {string|null} [recurrence] MaintenanceWindow recurrence + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken */ /** - * Constructs a new MaintenanceWindow. + * Constructs a new ListEnvironmentsResponse. * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a MaintenanceWindow. - * @implements IMaintenanceWindow + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set */ - function MaintenanceWindow(properties) { + function ListEnvironmentsResponse(properties) { + this.environments = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12432,522 +12080,8056 @@ } /** - * MaintenanceWindow startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @instance - */ - MaintenanceWindow.prototype.startTime = null; - - /** - * MaintenanceWindow endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @instance */ - MaintenanceWindow.prototype.endTime = null; + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; /** - * MaintenanceWindow recurrence. - * @member {string} recurrence - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @instance */ - MaintenanceWindow.prototype.recurrence = ""; + ListEnvironmentsResponse.prototype.nextPageToken = ""; /** - * Creates a new MaintenanceWindow instance using the specified properties. + * Creates a new ListEnvironmentsResponse instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance */ - MaintenanceWindow.create = function create(properties) { - return new MaintenanceWindow(properties); + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); }; /** - * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encode = function encode(message, writer) { + ListEnvironmentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.recurrence); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environments[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; }; /** - * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MaintenanceWindow message from the specified reader or buffer. + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MaintenanceWindow.decode = function decode(reader, length) { + ListEnvironmentsResponse.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.orchestration.airflow.service.v1beta1.MaintenanceWindow(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32())); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.recurrence = reader.string(); + message.nextPageToken = reader.string(); break; } default: reader.skipType(tag & 7); break; } - } - return message; - }; + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environments[i]); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEnvironmentsResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEnvironmentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ListEnvironmentsResponse"; + }; + + return ListEnvironmentsResponse; + })(); + + v1beta1.DeleteEnvironmentRequest = (function() { + + /** + * Properties of a DeleteEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IDeleteEnvironmentRequest + * @property {string|null} [name] DeleteEnvironmentRequest name + */ + + /** + * Constructs a new DeleteEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a DeleteEnvironmentRequest. + * @implements IDeleteEnvironmentRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + */ + function DeleteEnvironmentRequest(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]]; + } + + /** + * DeleteEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @instance + */ + DeleteEnvironmentRequest.prototype.name = ""; + + /** + * Creates a new DeleteEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest instance + */ + DeleteEnvironmentRequest.create = function create(properties) { + return new DeleteEnvironmentRequest(properties); + }; + + /** + * Encodes the specified DeleteEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDeleteEnvironmentRequest} message DeleteEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.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.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); + 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 DeleteEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteEnvironmentRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} DeleteEnvironmentRequest + */ + DeleteEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest} message DeleteEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEnvironmentRequest.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 DeleteEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DeleteEnvironmentRequest"; + }; + + return DeleteEnvironmentRequest; + })(); + + v1beta1.UpdateEnvironmentRequest = (function() { + + /** + * Properties of an UpdateEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IUpdateEnvironmentRequest + * @property {string|null} [name] UpdateEnvironmentRequest name + * @property {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null} [environment] UpdateEnvironmentRequest environment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEnvironmentRequest updateMask + */ + + /** + * Constructs a new UpdateEnvironmentRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an UpdateEnvironmentRequest. + * @implements IUpdateEnvironmentRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + */ + function UpdateEnvironmentRequest(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]]; + } + + /** + * UpdateEnvironmentRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.name = ""; + + /** + * UpdateEnvironmentRequest environment. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IEnvironment|null|undefined} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.environment = null; + + /** + * UpdateEnvironmentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance + */ + UpdateEnvironmentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateEnvironmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest instance + */ + UpdateEnvironmentRequest.create = function create(properties) { + return new UpdateEnvironmentRequest(properties); + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.encode(message.environment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateEnvironmentRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IUpdateEnvironmentRequest} message UpdateEnvironmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEnvironmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.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.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.name = reader.string(); + break; + } + case 1: { + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateEnvironmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEnvironmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateEnvironmentRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEnvironmentRequest.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.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.verify(message.environment); + if (error) + return "environment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateEnvironmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} UpdateEnvironmentRequest + */ + UpdateEnvironmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.environment: object expected"); + message.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.fromObject(object.environment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateEnvironmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest} message UpdateEnvironmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEnvironmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = null; + object.name = ""; + object.updateMask = null; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.cloud.orchestration.airflow.service.v1beta1.Environment.toObject(message.environment, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateEnvironmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEnvironmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateEnvironmentRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateEnvironmentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.UpdateEnvironmentRequest"; + }; + + return UpdateEnvironmentRequest; + })(); + + v1beta1.RestartWebServerRequest = (function() { + + /** + * Properties of a RestartWebServerRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IRestartWebServerRequest + * @property {string|null} [name] RestartWebServerRequest name + */ + + /** + * Constructs a new RestartWebServerRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a RestartWebServerRequest. + * @implements IRestartWebServerRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set + */ + function RestartWebServerRequest(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]]; + } + + /** + * RestartWebServerRequest name. + * @member {string} name + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @instance + */ + RestartWebServerRequest.prototype.name = ""; + + /** + * Creates a new RestartWebServerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest instance + */ + RestartWebServerRequest.create = function create(properties) { + return new RestartWebServerRequest(properties); + }; + + /** + * Encodes the specified RestartWebServerRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartWebServerRequest.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 RestartWebServerRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRestartWebServerRequest} message RestartWebServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartWebServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartWebServerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartWebServerRequest.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.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); + 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 RestartWebServerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartWebServerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartWebServerRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartWebServerRequest.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 RestartWebServerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} RestartWebServerRequest + */ + RestartWebServerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestartWebServerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest} message RestartWebServerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartWebServerRequest.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 RestartWebServerRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @instance + * @returns {Object.} JSON object + */ + RestartWebServerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestartWebServerRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartWebServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.RestartWebServerRequest"; + }; + + return RestartWebServerRequest; + })(); + + v1beta1.ExecuteAirflowCommandResponse = (function() { + + /** + * Properties of an ExecuteAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IExecuteAirflowCommandResponse + * @property {string|null} [executionId] ExecuteAirflowCommandResponse executionId + * @property {string|null} [pod] ExecuteAirflowCommandResponse pod + * @property {string|null} [podNamespace] ExecuteAirflowCommandResponse podNamespace + * @property {string|null} [error] ExecuteAirflowCommandResponse error + */ + + /** + * Constructs a new ExecuteAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an ExecuteAirflowCommandResponse. + * @implements IExecuteAirflowCommandResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set + */ + function ExecuteAirflowCommandResponse(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]]; + } + + /** + * ExecuteAirflowCommandResponse executionId. + * @member {string} executionId + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.executionId = ""; + + /** + * ExecuteAirflowCommandResponse pod. + * @member {string} pod + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.pod = ""; + + /** + * ExecuteAirflowCommandResponse podNamespace. + * @member {string} podNamespace + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.podNamespace = ""; + + /** + * ExecuteAirflowCommandResponse error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + */ + ExecuteAirflowCommandResponse.prototype.error = ""; + + /** + * Creates a new ExecuteAirflowCommandResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse instance + */ + ExecuteAirflowCommandResponse.create = function create(properties) { + return new ExecuteAirflowCommandResponse(properties); + }; + + /** + * Encodes the specified ExecuteAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteAirflowCommandResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executionId != null && Object.hasOwnProperty.call(message, "executionId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executionId); + if (message.pod != null && Object.hasOwnProperty.call(message, "pod")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pod); + if (message.podNamespace != null && Object.hasOwnProperty.call(message, "podNamespace")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.podNamespace); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.error); + return writer; + }; + + /** + * Encodes the specified ExecuteAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteAirflowCommandResponse.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.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.executionId = reader.string(); + break; + } + case 2: { + message.pod = reader.string(); + break; + } + case 3: { + message.podNamespace = reader.string(); + break; + } + case 4: { + message.error = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteAirflowCommandResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteAirflowCommandResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteAirflowCommandResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executionId != null && message.hasOwnProperty("executionId")) + if (!$util.isString(message.executionId)) + return "executionId: string expected"; + if (message.pod != null && message.hasOwnProperty("pod")) + if (!$util.isString(message.pod)) + return "pod: string expected"; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + if (!$util.isString(message.podNamespace)) + return "podNamespace: string expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates an ExecuteAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} ExecuteAirflowCommandResponse + */ + ExecuteAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse(); + if (object.executionId != null) + message.executionId = String(object.executionId); + if (object.pod != null) + message.pod = String(object.pod); + if (object.podNamespace != null) + message.podNamespace = String(object.podNamespace); + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from an ExecuteAirflowCommandResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse} message ExecuteAirflowCommandResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteAirflowCommandResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executionId = ""; + object.pod = ""; + object.podNamespace = ""; + object.error = ""; + } + if (message.executionId != null && message.hasOwnProperty("executionId")) + object.executionId = message.executionId; + if (message.pod != null && message.hasOwnProperty("pod")) + object.pod = message.pod; + if (message.podNamespace != null && message.hasOwnProperty("podNamespace")) + object.podNamespace = message.podNamespace; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this ExecuteAirflowCommandResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @instance + * @returns {Object.} JSON object + */ + ExecuteAirflowCommandResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteAirflowCommandResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ExecuteAirflowCommandResponse"; + }; + + return ExecuteAirflowCommandResponse; + })(); + + v1beta1.PollAirflowCommandResponse = (function() { + + /** + * Properties of a PollAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IPollAirflowCommandResponse + * @property {Array.|null} [output] PollAirflowCommandResponse output + * @property {boolean|null} [outputEnd] PollAirflowCommandResponse outputEnd + * @property {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null} [exitInfo] PollAirflowCommandResponse exitInfo + */ + + /** + * Constructs a new PollAirflowCommandResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a PollAirflowCommandResponse. + * @implements IPollAirflowCommandResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set + */ + function PollAirflowCommandResponse(properties) { + this.output = []; + 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]]; + } + + /** + * PollAirflowCommandResponse output. + * @member {Array.} output + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @instance + */ + PollAirflowCommandResponse.prototype.output = $util.emptyArray; + + /** + * PollAirflowCommandResponse outputEnd. + * @member {boolean} outputEnd + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @instance + */ + PollAirflowCommandResponse.prototype.outputEnd = false; + + /** + * PollAirflowCommandResponse exitInfo. + * @member {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo|null|undefined} exitInfo + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @instance + */ + PollAirflowCommandResponse.prototype.exitInfo = null; + + /** + * Creates a new PollAirflowCommandResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse instance + */ + PollAirflowCommandResponse.create = function create(properties) { + return new PollAirflowCommandResponse(properties); + }; + + /** + * Encodes the specified PollAirflowCommandResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollAirflowCommandResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.output != null && message.output.length) + for (var i = 0; i < message.output.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.encode(message.output[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputEnd != null && Object.hasOwnProperty.call(message, "outputEnd")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.outputEnd); + if (message.exitInfo != null && Object.hasOwnProperty.call(message, "exitInfo")) + $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.encode(message.exitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PollAirflowCommandResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPollAirflowCommandResponse} message PollAirflowCommandResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollAirflowCommandResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollAirflowCommandResponse.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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.output && message.output.length)) + message.output = []; + message.output.push($root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.decode(reader, reader.uint32())); + break; + } + case 2: { + message.outputEnd = reader.bool(); + break; + } + case 3: { + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PollAirflowCommandResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollAirflowCommandResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PollAirflowCommandResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PollAirflowCommandResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.output != null && message.hasOwnProperty("output")) { + if (!Array.isArray(message.output)) + return "output: array expected"; + for (var i = 0; i < message.output.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify(message.output[i]); + if (error) + return "output." + error; + } + } + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + if (typeof message.outputEnd !== "boolean") + return "outputEnd: boolean expected"; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify(message.exitInfo); + if (error) + return "exitInfo." + error; + } + return null; + }; + + /** + * Creates a PollAirflowCommandResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} PollAirflowCommandResponse + */ + PollAirflowCommandResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse(); + if (object.output) { + if (!Array.isArray(object.output)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: array expected"); + message.output = []; + for (var i = 0; i < object.output.length; ++i) { + if (typeof object.output[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.output: object expected"); + message.output[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.fromObject(object.output[i]); + } + } + if (object.outputEnd != null) + message.outputEnd = Boolean(object.outputEnd); + if (object.exitInfo != null) { + if (typeof object.exitInfo !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.exitInfo: object expected"); + message.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.fromObject(object.exitInfo); + } + return message; + }; + + /** + * Creates a plain object from a PollAirflowCommandResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse} message PollAirflowCommandResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PollAirflowCommandResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.output = []; + if (options.defaults) { + object.outputEnd = false; + object.exitInfo = null; + } + if (message.output && message.output.length) { + object.output = []; + for (var j = 0; j < message.output.length; ++j) + object.output[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.toObject(message.output[j], options); + } + if (message.outputEnd != null && message.hasOwnProperty("outputEnd")) + object.outputEnd = message.outputEnd; + if (message.exitInfo != null && message.hasOwnProperty("exitInfo")) + object.exitInfo = $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.toObject(message.exitInfo, options); + return object; + }; + + /** + * Converts this PollAirflowCommandResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @instance + * @returns {Object.} JSON object + */ + PollAirflowCommandResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PollAirflowCommandResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PollAirflowCommandResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse"; + }; + + PollAirflowCommandResponse.Line = (function() { + + /** + * Properties of a Line. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @interface ILine + * @property {number|null} [lineNumber] Line lineNumber + * @property {string|null} [content] Line content + */ + + /** + * Constructs a new Line. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @classdesc Represents a Line. + * @implements ILine + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + */ + function Line(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]]; + } + + /** + * Line lineNumber. + * @member {number} lineNumber + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.lineNumber = 0; + + /** + * Line content. + * @member {string} content + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + */ + Line.prototype.content = ""; + + /** + * Creates a new Line instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line instance + */ + Line.create = function create(properties) { + return new Line(properties); + }; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lineNumber != null && Object.hasOwnProperty.call(message, "lineNumber")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lineNumber); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + return writer; + }; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ILine} message Line message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Line.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Line message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lineNumber = reader.int32(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Line message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Line.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Line message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Line.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + if (!$util.isInteger(message.lineNumber)) + return "lineNumber: integer expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a Line message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} Line + */ + Line.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line(); + if (object.lineNumber != null) + message.lineNumber = object.lineNumber | 0; + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a Line message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line} message Line + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Line.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lineNumber = 0; + object.content = ""; + } + if (message.lineNumber != null && message.hasOwnProperty("lineNumber")) + object.lineNumber = message.lineNumber; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this Line to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @instance + * @returns {Object.} JSON object + */ + Line.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Line + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Line.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.Line"; + }; + + return Line; + })(); + + PollAirflowCommandResponse.ExitInfo = (function() { + + /** + * Properties of an ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @interface IExitInfo + * @property {number|null} [exitCode] ExitInfo exitCode + * @property {string|null} [error] ExitInfo error + */ + + /** + * Constructs a new ExitInfo. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse + * @classdesc Represents an ExitInfo. + * @implements IExitInfo + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set + */ + function ExitInfo(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]]; + } + + /** + * ExitInfo exitCode. + * @member {number} exitCode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + */ + ExitInfo.prototype.exitCode = 0; + + /** + * ExitInfo error. + * @member {string} error + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + */ + ExitInfo.prototype.error = ""; + + /** + * Creates a new ExitInfo instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo instance + */ + ExitInfo.create = function create(properties) { + return new ExitInfo(properties); + }; + + /** + * Encodes the specified ExitInfo message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.exitCode); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); + return writer; + }; + + /** + * Encodes the specified ExitInfo message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.IExitInfo} message ExitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExitInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExitInfo.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.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.exitCode = reader.int32(); + break; + } + case 2: { + message.error = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExitInfo message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates an ExitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} ExitInfo + */ + ExitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo(); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from an ExitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo} message ExitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.exitCode = 0; + object.error = ""; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this ExitInfo to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @instance + * @returns {Object.} JSON object + */ + ExitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExitInfo + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExitInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PollAirflowCommandResponse.ExitInfo"; + }; + + return ExitInfo; + })(); + + return PollAirflowCommandResponse; + })(); + + v1beta1.SaveSnapshotRequest = (function() { + + /** + * Properties of a SaveSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ISaveSnapshotRequest + * @property {string|null} [environment] SaveSnapshotRequest environment + * @property {string|null} [snapshotLocation] SaveSnapshotRequest snapshotLocation + */ + + /** + * Constructs a new SaveSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a SaveSnapshotRequest. + * @implements ISaveSnapshotRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set + */ + function SaveSnapshotRequest(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]]; + } + + /** + * SaveSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @instance + */ + SaveSnapshotRequest.prototype.environment = ""; + + /** + * SaveSnapshotRequest snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @instance + */ + SaveSnapshotRequest.prototype.snapshotLocation = ""; + + /** + * Creates a new SaveSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest instance + */ + SaveSnapshotRequest.create = function create(properties) { + return new SaveSnapshotRequest(properties); + }; + + /** + * Encodes the specified SaveSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotLocation); + return writer; + }; + + /** + * Encodes the specified SaveSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest} message SaveSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SaveSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveSnapshotRequest.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.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.snapshotLocation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SaveSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SaveSnapshotRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SaveSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; + return null; + }; + + /** + * Creates a SaveSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} SaveSnapshotRequest + */ + SaveSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); + return message; + }; + + /** + * Creates a plain object from a SaveSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest} message SaveSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SaveSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.snapshotLocation = ""; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; + return object; + }; + + /** + * Converts this SaveSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + SaveSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SaveSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SaveSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest"; + }; + + return SaveSnapshotRequest; + })(); + + v1beta1.SaveSnapshotResponse = (function() { + + /** + * Properties of a SaveSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ISaveSnapshotResponse + * @property {string|null} [snapshotPath] SaveSnapshotResponse snapshotPath + */ + + /** + * Constructs a new SaveSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a SaveSnapshotResponse. + * @implements ISaveSnapshotResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set + */ + function SaveSnapshotResponse(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]]; + } + + /** + * SaveSnapshotResponse snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @instance + */ + SaveSnapshotResponse.prototype.snapshotPath = ""; + + /** + * Creates a new SaveSnapshotResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse instance + */ + SaveSnapshotResponse.create = function create(properties) { + return new SaveSnapshotResponse(properties); + }; + + /** + * Encodes the specified SaveSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveSnapshotResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshotPath); + return writer; + }; + + /** + * Encodes the specified SaveSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse} message SaveSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaveSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SaveSnapshotResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveSnapshotResponse.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.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.snapshotPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SaveSnapshotResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaveSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SaveSnapshotResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SaveSnapshotResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; + return null; + }; + + /** + * Creates a SaveSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} SaveSnapshotResponse + */ + SaveSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse(); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); + return message; + }; + + /** + * Creates a plain object from a SaveSnapshotResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse} message SaveSnapshotResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SaveSnapshotResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.snapshotPath = ""; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; + return object; + }; + + /** + * Converts this SaveSnapshotResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @instance + * @returns {Object.} JSON object + */ + SaveSnapshotResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SaveSnapshotResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SaveSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse"; + }; + + return SaveSnapshotResponse; + })(); + + v1beta1.LoadSnapshotRequest = (function() { + + /** + * Properties of a LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ILoadSnapshotRequest + * @property {string|null} [environment] LoadSnapshotRequest environment + * @property {string|null} [snapshotPath] LoadSnapshotRequest snapshotPath + * @property {boolean|null} [skipPypiPackagesInstallation] LoadSnapshotRequest skipPypiPackagesInstallation + * @property {boolean|null} [skipEnvironmentVariablesSetting] LoadSnapshotRequest skipEnvironmentVariablesSetting + * @property {boolean|null} [skipAirflowOverridesSetting] LoadSnapshotRequest skipAirflowOverridesSetting + * @property {boolean|null} [skipGcsDataCopying] LoadSnapshotRequest skipGcsDataCopying + */ + + /** + * Constructs a new LoadSnapshotRequest. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a LoadSnapshotRequest. + * @implements ILoadSnapshotRequest + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set + */ + function LoadSnapshotRequest(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]]; + } + + /** + * LoadSnapshotRequest environment. + * @member {string} environment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.environment = ""; + + /** + * LoadSnapshotRequest snapshotPath. + * @member {string} snapshotPath + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.snapshotPath = ""; + + /** + * LoadSnapshotRequest skipPypiPackagesInstallation. + * @member {boolean} skipPypiPackagesInstallation + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipPypiPackagesInstallation = false; + + /** + * LoadSnapshotRequest skipEnvironmentVariablesSetting. + * @member {boolean} skipEnvironmentVariablesSetting + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipEnvironmentVariablesSetting = false; + + /** + * LoadSnapshotRequest skipAirflowOverridesSetting. + * @member {boolean} skipAirflowOverridesSetting + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipAirflowOverridesSetting = false; + + /** + * LoadSnapshotRequest skipGcsDataCopying. + * @member {boolean} skipGcsDataCopying + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + */ + LoadSnapshotRequest.prototype.skipGcsDataCopying = false; + + /** + * Creates a new LoadSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest instance + */ + LoadSnapshotRequest.create = function create(properties) { + return new LoadSnapshotRequest(properties); + }; + + /** + * Encodes the specified LoadSnapshotRequest message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.environment); + if (message.snapshotPath != null && Object.hasOwnProperty.call(message, "snapshotPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotPath); + if (message.skipPypiPackagesInstallation != null && Object.hasOwnProperty.call(message, "skipPypiPackagesInstallation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipPypiPackagesInstallation); + if (message.skipEnvironmentVariablesSetting != null && Object.hasOwnProperty.call(message, "skipEnvironmentVariablesSetting")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipEnvironmentVariablesSetting); + if (message.skipAirflowOverridesSetting != null && Object.hasOwnProperty.call(message, "skipAirflowOverridesSetting")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipAirflowOverridesSetting); + if (message.skipGcsDataCopying != null && Object.hasOwnProperty.call(message, "skipGcsDataCopying")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipGcsDataCopying); + return writer; + }; + + /** + * Encodes the specified LoadSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest} message LoadSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotRequest.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.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.environment = reader.string(); + break; + } + case 2: { + message.snapshotPath = reader.string(); + break; + } + case 3: { + message.skipPypiPackagesInstallation = reader.bool(); + break; + } + case 4: { + message.skipEnvironmentVariablesSetting = reader.bool(); + break; + } + case 5: { + message.skipAirflowOverridesSetting = reader.bool(); + break; + } + case 6: { + message.skipGcsDataCopying = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadSnapshotRequest message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + if (!$util.isString(message.snapshotPath)) + return "snapshotPath: string expected"; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + if (typeof message.skipPypiPackagesInstallation !== "boolean") + return "skipPypiPackagesInstallation: boolean expected"; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + if (typeof message.skipEnvironmentVariablesSetting !== "boolean") + return "skipEnvironmentVariablesSetting: boolean expected"; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + if (typeof message.skipAirflowOverridesSetting !== "boolean") + return "skipAirflowOverridesSetting: boolean expected"; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + if (typeof message.skipGcsDataCopying !== "boolean") + return "skipGcsDataCopying: boolean expected"; + return null; + }; + + /** + * Creates a LoadSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} LoadSnapshotRequest + */ + LoadSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest(); + if (object.environment != null) + message.environment = String(object.environment); + if (object.snapshotPath != null) + message.snapshotPath = String(object.snapshotPath); + if (object.skipPypiPackagesInstallation != null) + message.skipPypiPackagesInstallation = Boolean(object.skipPypiPackagesInstallation); + if (object.skipEnvironmentVariablesSetting != null) + message.skipEnvironmentVariablesSetting = Boolean(object.skipEnvironmentVariablesSetting); + if (object.skipAirflowOverridesSetting != null) + message.skipAirflowOverridesSetting = Boolean(object.skipAirflowOverridesSetting); + if (object.skipGcsDataCopying != null) + message.skipGcsDataCopying = Boolean(object.skipGcsDataCopying); + return message; + }; + + /** + * Creates a plain object from a LoadSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest} message LoadSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.environment = ""; + object.snapshotPath = ""; + object.skipPypiPackagesInstallation = false; + object.skipEnvironmentVariablesSetting = false; + object.skipAirflowOverridesSetting = false; + object.skipGcsDataCopying = false; + } + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.snapshotPath != null && message.hasOwnProperty("snapshotPath")) + object.snapshotPath = message.snapshotPath; + if (message.skipPypiPackagesInstallation != null && message.hasOwnProperty("skipPypiPackagesInstallation")) + object.skipPypiPackagesInstallation = message.skipPypiPackagesInstallation; + if (message.skipEnvironmentVariablesSetting != null && message.hasOwnProperty("skipEnvironmentVariablesSetting")) + object.skipEnvironmentVariablesSetting = message.skipEnvironmentVariablesSetting; + if (message.skipAirflowOverridesSetting != null && message.hasOwnProperty("skipAirflowOverridesSetting")) + object.skipAirflowOverridesSetting = message.skipAirflowOverridesSetting; + if (message.skipGcsDataCopying != null && message.hasOwnProperty("skipGcsDataCopying")) + object.skipGcsDataCopying = message.skipGcsDataCopying; + return object; + }; + + /** + * Converts this LoadSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + LoadSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest"; + }; + + return LoadSnapshotRequest; + })(); + + v1beta1.LoadSnapshotResponse = (function() { + + /** + * Properties of a LoadSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ILoadSnapshotResponse + */ + + /** + * Constructs a new LoadSnapshotResponse. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a LoadSnapshotResponse. + * @implements ILoadSnapshotResponse + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set + */ + function LoadSnapshotResponse(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 LoadSnapshotResponse instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse instance + */ + LoadSnapshotResponse.create = function create(properties) { + return new LoadSnapshotResponse(properties); + }; + + /** + * Encodes the specified LoadSnapshotResponse message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified LoadSnapshotResponse message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse} message LoadSnapshotResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadSnapshotResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotResponse.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.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadSnapshotResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadSnapshotResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadSnapshotResponse message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadSnapshotResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a LoadSnapshotResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} LoadSnapshotResponse + */ + LoadSnapshotResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse) + return object; + return new $root.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse(); + }; + + /** + * Creates a plain object from a LoadSnapshotResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse} message LoadSnapshotResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadSnapshotResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this LoadSnapshotResponse to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @instance + * @returns {Object.} JSON object + */ + LoadSnapshotResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadSnapshotResponse + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadSnapshotResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse"; + }; + + return LoadSnapshotResponse; + })(); + + v1beta1.EnvironmentConfig = (function() { + + /** + * Properties of an EnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IEnvironmentConfig + * @property {string|null} [gkeCluster] EnvironmentConfig gkeCluster + * @property {string|null} [dagGcsPrefix] EnvironmentConfig dagGcsPrefix + * @property {number|null} [nodeCount] EnvironmentConfig nodeCount + * @property {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null} [softwareConfig] EnvironmentConfig softwareConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null} [nodeConfig] EnvironmentConfig nodeConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null} [privateEnvironmentConfig] EnvironmentConfig privateEnvironmentConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null} [webServerNetworkAccessControl] EnvironmentConfig webServerNetworkAccessControl + * @property {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null} [databaseConfig] EnvironmentConfig databaseConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null} [webServerConfig] EnvironmentConfig webServerConfig + * @property {string|null} [airflowUri] EnvironmentConfig airflowUri + * @property {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null} [encryptionConfig] EnvironmentConfig encryptionConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null} [maintenanceWindow] EnvironmentConfig maintenanceWindow + * @property {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null} [workloadsConfig] EnvironmentConfig workloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize|null} [environmentSize] EnvironmentConfig environmentSize + * @property {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig|null} [masterAuthorizedNetworksConfig] EnvironmentConfig masterAuthorizedNetworksConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null} [recoveryConfig] EnvironmentConfig recoveryConfig + */ + + /** + * Constructs a new EnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an EnvironmentConfig. + * @implements IEnvironmentConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig=} [properties] Properties to set + */ + function EnvironmentConfig(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]]; + } + + /** + * EnvironmentConfig gkeCluster. + * @member {string} gkeCluster + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.gkeCluster = ""; + + /** + * EnvironmentConfig dagGcsPrefix. + * @member {string} dagGcsPrefix + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.dagGcsPrefix = ""; + + /** + * EnvironmentConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.nodeCount = 0; + + /** + * EnvironmentConfig softwareConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.softwareConfig = null; + + /** + * EnvironmentConfig nodeConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.nodeConfig = null; + + /** + * EnvironmentConfig privateEnvironmentConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig|null|undefined} privateEnvironmentConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.privateEnvironmentConfig = null; + + /** + * EnvironmentConfig webServerNetworkAccessControl. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl|null|undefined} webServerNetworkAccessControl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.webServerNetworkAccessControl = null; + + /** + * EnvironmentConfig databaseConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig|null|undefined} databaseConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.databaseConfig = null; + + /** + * EnvironmentConfig webServerConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig|null|undefined} webServerConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.webServerConfig = null; + + /** + * EnvironmentConfig airflowUri. + * @member {string} airflowUri + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.airflowUri = ""; + + /** + * EnvironmentConfig encryptionConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.encryptionConfig = null; + + /** + * EnvironmentConfig maintenanceWindow. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow|null|undefined} maintenanceWindow + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.maintenanceWindow = null; + + /** + * EnvironmentConfig workloadsConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig|null|undefined} workloadsConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.workloadsConfig = null; + + /** + * EnvironmentConfig environmentSize. + * @member {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize} environmentSize + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.environmentSize = 0; + + /** + * EnvironmentConfig masterAuthorizedNetworksConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig|null|undefined} masterAuthorizedNetworksConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.masterAuthorizedNetworksConfig = null; + + /** + * EnvironmentConfig recoveryConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig|null|undefined} recoveryConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.recoveryConfig = null; + + /** + * Creates a new EnvironmentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig instance + */ + EnvironmentConfig.create = function create(properties) { + return new EnvironmentConfig(properties); + }; + + /** + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gkeCluster != null && Object.hasOwnProperty.call(message, "gkeCluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gkeCluster); + if (message.dagGcsPrefix != null && Object.hasOwnProperty.call(message, "dagGcsPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dagGcsPrefix); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nodeCount); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.airflowUri != null && Object.hasOwnProperty.call(message, "airflowUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.airflowUri); + if (message.privateEnvironmentConfig != null && Object.hasOwnProperty.call(message, "privateEnvironmentConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.encode(message.privateEnvironmentConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webServerNetworkAccessControl != null && Object.hasOwnProperty.call(message, "webServerNetworkAccessControl")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.encode(message.webServerNetworkAccessControl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.databaseConfig != null && Object.hasOwnProperty.call(message, "databaseConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.encode(message.databaseConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.webServerConfig != null && Object.hasOwnProperty.call(message, "webServerConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.encode(message.webServerConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.workloadsConfig != null && Object.hasOwnProperty.call(message, "workloadsConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.encode(message.workloadsConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.environmentSize != null && Object.hasOwnProperty.call(message, "environmentSize")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.environmentSize); + if (message.masterAuthorizedNetworksConfig != null && Object.hasOwnProperty.call(message, "masterAuthorizedNetworksConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.encode(message.masterAuthorizedNetworksConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.recoveryConfig != null && Object.hasOwnProperty.call(message, "recoveryConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.encode(message.recoveryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentConfig.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.orchestration.airflow.service.v1beta1.EnvironmentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gkeCluster = reader.string(); + break; + } + case 2: { + message.dagGcsPrefix = reader.string(); + break; + } + case 3: { + message.nodeCount = reader.int32(); + break; + } + case 4: { + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.decode(reader, reader.uint32()); + break; + } + case 10: { + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.airflowUri = reader.string(); + break; + } + case 12: { + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.decode(reader, reader.uint32()); + break; + } + case 15: { + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.environmentSize = reader.int32(); + break; + } + case 17: { + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvironmentConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvironmentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + if (!$util.isString(message.gkeCluster)) + return "gkeCluster: string expected"; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + if (!$util.isString(message.dagGcsPrefix)) + return "dagGcsPrefix: string expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify(message.privateEnvironmentConfig); + if (error) + return "privateEnvironmentConfig." + error; + } + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify(message.webServerNetworkAccessControl); + if (error) + return "webServerNetworkAccessControl." + error; + } + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify(message.databaseConfig); + if (error) + return "databaseConfig." + error; + } + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify(message.webServerConfig); + if (error) + return "webServerConfig." + error; + } + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + if (!$util.isString(message.airflowUri)) + return "airflowUri: string expected"; + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify(message.maintenanceWindow); + if (error) + return "maintenanceWindow." + error; + } + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify(message.workloadsConfig); + if (error) + return "workloadsConfig." + error; + } + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + switch (message.environmentSize) { + default: + return "environmentSize: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.verify(message.masterAuthorizedNetworksConfig); + if (error) + return "masterAuthorizedNetworksConfig." + error; + } + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.verify(message.recoveryConfig); + if (error) + return "recoveryConfig." + error; + } + return null; + }; + + /** + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} EnvironmentConfig + */ + EnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig(); + if (object.gkeCluster != null) + message.gkeCluster = String(object.gkeCluster); + if (object.dagGcsPrefix != null) + message.dagGcsPrefix = String(object.dagGcsPrefix); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.fromObject(object.softwareConfig); + } + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.fromObject(object.nodeConfig); + } + if (object.privateEnvironmentConfig != null) { + if (typeof object.privateEnvironmentConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.privateEnvironmentConfig: object expected"); + message.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.fromObject(object.privateEnvironmentConfig); + } + if (object.webServerNetworkAccessControl != null) { + if (typeof object.webServerNetworkAccessControl !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.webServerNetworkAccessControl: object expected"); + message.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.fromObject(object.webServerNetworkAccessControl); + } + if (object.databaseConfig != null) { + if (typeof object.databaseConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.databaseConfig: object expected"); + message.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.fromObject(object.databaseConfig); + } + if (object.webServerConfig != null) { + if (typeof object.webServerConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.webServerConfig: object expected"); + message.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.fromObject(object.webServerConfig); + } + if (object.airflowUri != null) + message.airflowUri = String(object.airflowUri); + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.maintenanceWindow != null) { + if (typeof object.maintenanceWindow !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.maintenanceWindow: object expected"); + message.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.fromObject(object.maintenanceWindow); + } + if (object.workloadsConfig != null) { + if (typeof object.workloadsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.workloadsConfig: object expected"); + message.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.fromObject(object.workloadsConfig); + } + switch (object.environmentSize) { + default: + if (typeof object.environmentSize === "number") { + message.environmentSize = object.environmentSize; + break; + } + break; + case "ENVIRONMENT_SIZE_UNSPECIFIED": + case 0: + message.environmentSize = 0; + break; + case "ENVIRONMENT_SIZE_SMALL": + case 1: + message.environmentSize = 1; + break; + case "ENVIRONMENT_SIZE_MEDIUM": + case 2: + message.environmentSize = 2; + break; + case "ENVIRONMENT_SIZE_LARGE": + case 3: + message.environmentSize = 3; + break; + } + if (object.masterAuthorizedNetworksConfig != null) { + if (typeof object.masterAuthorizedNetworksConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.masterAuthorizedNetworksConfig: object expected"); + message.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.fromObject(object.masterAuthorizedNetworksConfig); + } + if (object.recoveryConfig != null) { + if (typeof object.recoveryConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.recoveryConfig: object expected"); + message.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.fromObject(object.recoveryConfig); + } + return message; + }; + + /** + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig} message EnvironmentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvironmentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gkeCluster = ""; + object.dagGcsPrefix = ""; + object.nodeCount = 0; + object.softwareConfig = null; + object.nodeConfig = null; + object.airflowUri = ""; + object.privateEnvironmentConfig = null; + object.webServerNetworkAccessControl = null; + object.databaseConfig = null; + object.webServerConfig = null; + object.encryptionConfig = null; + object.maintenanceWindow = null; + object.workloadsConfig = null; + object.environmentSize = options.enums === String ? "ENVIRONMENT_SIZE_UNSPECIFIED" : 0; + object.masterAuthorizedNetworksConfig = null; + object.recoveryConfig = null; + } + if (message.gkeCluster != null && message.hasOwnProperty("gkeCluster")) + object.gkeCluster = message.gkeCluster; + if (message.dagGcsPrefix != null && message.hasOwnProperty("dagGcsPrefix")) + object.dagGcsPrefix = message.dagGcsPrefix; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.toObject(message.softwareConfig, options); + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.toObject(message.nodeConfig, options); + if (message.airflowUri != null && message.hasOwnProperty("airflowUri")) + object.airflowUri = message.airflowUri; + if (message.privateEnvironmentConfig != null && message.hasOwnProperty("privateEnvironmentConfig")) + object.privateEnvironmentConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.toObject(message.privateEnvironmentConfig, options); + if (message.webServerNetworkAccessControl != null && message.hasOwnProperty("webServerNetworkAccessControl")) + object.webServerNetworkAccessControl = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.toObject(message.webServerNetworkAccessControl, options); + if (message.databaseConfig != null && message.hasOwnProperty("databaseConfig")) + object.databaseConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.toObject(message.databaseConfig, options); + if (message.webServerConfig != null && message.hasOwnProperty("webServerConfig")) + object.webServerConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.toObject(message.webServerConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) + object.maintenanceWindow = $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.toObject(message.maintenanceWindow, options); + if (message.workloadsConfig != null && message.hasOwnProperty("workloadsConfig")) + object.workloadsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.toObject(message.workloadsConfig, options); + if (message.environmentSize != null && message.hasOwnProperty("environmentSize")) + object.environmentSize = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize[message.environmentSize] === undefined ? message.environmentSize : $root.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize[message.environmentSize] : message.environmentSize; + if (message.masterAuthorizedNetworksConfig != null && message.hasOwnProperty("masterAuthorizedNetworksConfig")) + object.masterAuthorizedNetworksConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.toObject(message.masterAuthorizedNetworksConfig, options); + if (message.recoveryConfig != null && message.hasOwnProperty("recoveryConfig")) + object.recoveryConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.toObject(message.recoveryConfig, options); + return object; + }; + + /** + * Converts this EnvironmentConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @instance + * @returns {Object.} JSON object + */ + EnvironmentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvironmentConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig"; + }; + + /** + * EnvironmentSize enum. + * @name google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize + * @enum {number} + * @property {number} ENVIRONMENT_SIZE_UNSPECIFIED=0 ENVIRONMENT_SIZE_UNSPECIFIED value + * @property {number} ENVIRONMENT_SIZE_SMALL=1 ENVIRONMENT_SIZE_SMALL value + * @property {number} ENVIRONMENT_SIZE_MEDIUM=2 ENVIRONMENT_SIZE_MEDIUM value + * @property {number} ENVIRONMENT_SIZE_LARGE=3 ENVIRONMENT_SIZE_LARGE value + */ + EnvironmentConfig.EnvironmentSize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENVIRONMENT_SIZE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENVIRONMENT_SIZE_SMALL"] = 1; + values[valuesById[2] = "ENVIRONMENT_SIZE_MEDIUM"] = 2; + values[valuesById[3] = "ENVIRONMENT_SIZE_LARGE"] = 3; + return values; + })(); + + return EnvironmentConfig; + })(); + + v1beta1.WebServerNetworkAccessControl = (function() { + + /** + * Properties of a WebServerNetworkAccessControl. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IWebServerNetworkAccessControl + * @property {Array.|null} [allowedIpRanges] WebServerNetworkAccessControl allowedIpRanges + */ + + /** + * Constructs a new WebServerNetworkAccessControl. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a WebServerNetworkAccessControl. + * @implements IWebServerNetworkAccessControl + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl=} [properties] Properties to set + */ + function WebServerNetworkAccessControl(properties) { + this.allowedIpRanges = []; + 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]]; + } + + /** + * WebServerNetworkAccessControl allowedIpRanges. + * @member {Array.} allowedIpRanges + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @instance + */ + WebServerNetworkAccessControl.prototype.allowedIpRanges = $util.emptyArray; + + /** + * Creates a new WebServerNetworkAccessControl instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl instance + */ + WebServerNetworkAccessControl.create = function create(properties) { + return new WebServerNetworkAccessControl(properties); + }; + + /** + * Encodes the specified WebServerNetworkAccessControl message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerNetworkAccessControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedIpRanges != null && message.allowedIpRanges.length) + for (var i = 0; i < message.allowedIpRanges.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.encode(message.allowedIpRanges[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebServerNetworkAccessControl message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerNetworkAccessControl} message WebServerNetworkAccessControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerNetworkAccessControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerNetworkAccessControl.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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedIpRanges && message.allowedIpRanges.length)) + message.allowedIpRanges = []; + message.allowedIpRanges.push($root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebServerNetworkAccessControl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerNetworkAccessControl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebServerNetworkAccessControl message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerNetworkAccessControl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedIpRanges != null && message.hasOwnProperty("allowedIpRanges")) { + if (!Array.isArray(message.allowedIpRanges)) + return "allowedIpRanges: array expected"; + for (var i = 0; i < message.allowedIpRanges.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify(message.allowedIpRanges[i]); + if (error) + return "allowedIpRanges." + error; + } + } + return null; + }; + + /** + * Creates a WebServerNetworkAccessControl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} WebServerNetworkAccessControl + */ + WebServerNetworkAccessControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl(); + if (object.allowedIpRanges) { + if (!Array.isArray(object.allowedIpRanges)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.allowedIpRanges: array expected"); + message.allowedIpRanges = []; + for (var i = 0; i < object.allowedIpRanges.length; ++i) { + if (typeof object.allowedIpRanges[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.allowedIpRanges: object expected"); + message.allowedIpRanges[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.fromObject(object.allowedIpRanges[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebServerNetworkAccessControl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl} message WebServerNetworkAccessControl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerNetworkAccessControl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedIpRanges = []; + if (message.allowedIpRanges && message.allowedIpRanges.length) { + object.allowedIpRanges = []; + for (var j = 0; j < message.allowedIpRanges.length; ++j) + object.allowedIpRanges[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.toObject(message.allowedIpRanges[j], options); + } + return object; + }; + + /** + * Converts this WebServerNetworkAccessControl to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @instance + * @returns {Object.} JSON object + */ + WebServerNetworkAccessControl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebServerNetworkAccessControl + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerNetworkAccessControl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl"; + }; + + WebServerNetworkAccessControl.AllowedIpRange = (function() { + + /** + * Properties of an AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @interface IAllowedIpRange + * @property {string|null} [value] AllowedIpRange value + * @property {string|null} [description] AllowedIpRange description + */ + + /** + * Constructs a new AllowedIpRange. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl + * @classdesc Represents an AllowedIpRange. + * @implements IAllowedIpRange + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + */ + function AllowedIpRange(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]]; + } + + /** + * AllowedIpRange value. + * @member {string} value + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.value = ""; + + /** + * AllowedIpRange description. + * @member {string} description + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + */ + AllowedIpRange.prototype.description = ""; + + /** + * Creates a new AllowedIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange instance + */ + AllowedIpRange.create = function create(properties) { + return new AllowedIpRange(properties); + }; + + /** + * Encodes the specified AllowedIpRange message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + return writer; + }; + + /** + * Encodes the specified AllowedIpRange message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.IAllowedIpRange} message AllowedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllowedIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.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.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllowedIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllowedIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllowedIpRange message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllowedIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an AllowedIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} AllowedIpRange + */ + AllowedIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange(); + if (object.value != null) + message.value = String(object.value); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an AllowedIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange} message AllowedIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllowedIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.description = ""; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this AllowedIpRange to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @instance + * @returns {Object.} JSON object + */ + AllowedIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllowedIpRange + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllowedIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerNetworkAccessControl.AllowedIpRange"; + }; + + return AllowedIpRange; + })(); + + return WebServerNetworkAccessControl; + })(); + + v1beta1.SoftwareConfig = (function() { + + /** + * Properties of a SoftwareConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ISoftwareConfig + * @property {string|null} [imageVersion] SoftwareConfig imageVersion + * @property {Object.|null} [airflowConfigOverrides] SoftwareConfig airflowConfigOverrides + * @property {Object.|null} [pypiPackages] SoftwareConfig pypiPackages + * @property {Object.|null} [envVariables] SoftwareConfig envVariables + * @property {string|null} [pythonVersion] SoftwareConfig pythonVersion + * @property {number|null} [schedulerCount] SoftwareConfig schedulerCount + * @property {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration|null} [cloudDataLineageIntegration] SoftwareConfig cloudDataLineageIntegration + */ + + /** + * Constructs a new SoftwareConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a SoftwareConfig. + * @implements ISoftwareConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig=} [properties] Properties to set + */ + function SoftwareConfig(properties) { + this.airflowConfigOverrides = {}; + this.pypiPackages = {}; + this.envVariables = {}; + 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]]; + } + + /** + * SoftwareConfig imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.imageVersion = ""; + + /** + * SoftwareConfig airflowConfigOverrides. + * @member {Object.} airflowConfigOverrides + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.airflowConfigOverrides = $util.emptyObject; + + /** + * SoftwareConfig pypiPackages. + * @member {Object.} pypiPackages + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.pypiPackages = $util.emptyObject; + + /** + * SoftwareConfig envVariables. + * @member {Object.} envVariables + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.envVariables = $util.emptyObject; + + /** + * SoftwareConfig pythonVersion. + * @member {string} pythonVersion + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.pythonVersion = ""; + + /** + * SoftwareConfig schedulerCount. + * @member {number} schedulerCount + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.schedulerCount = 0; + + /** + * SoftwareConfig cloudDataLineageIntegration. + * @member {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration|null|undefined} cloudDataLineageIntegration + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.cloudDataLineageIntegration = null; + + /** + * Creates a new SoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig instance + */ + SoftwareConfig.create = function create(properties) { + return new SoftwareConfig(properties); + }; + + /** + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); + if (message.airflowConfigOverrides != null && Object.hasOwnProperty.call(message, "airflowConfigOverrides")) + for (var keys = Object.keys(message.airflowConfigOverrides), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.airflowConfigOverrides[keys[i]]).ldelim(); + if (message.pypiPackages != null && Object.hasOwnProperty.call(message, "pypiPackages")) + for (var keys = Object.keys(message.pypiPackages), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.pypiPackages[keys[i]]).ldelim(); + if (message.envVariables != null && Object.hasOwnProperty.call(message, "envVariables")) + for (var keys = Object.keys(message.envVariables), 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.envVariables[keys[i]]).ldelim(); + if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pythonVersion); + if (message.schedulerCount != null && Object.hasOwnProperty.call(message, "schedulerCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.schedulerCount); + if (message.cloudDataLineageIntegration != null && Object.hasOwnProperty.call(message, "cloudDataLineageIntegration")) + $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.encode(message.cloudDataLineageIntegration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.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.orchestration.airflow.service.v1beta1.SoftwareConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageVersion = reader.string(); + break; + } + case 2: { + if (message.airflowConfigOverrides === $util.emptyObject) + message.airflowConfigOverrides = {}; + 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.airflowConfigOverrides[key] = value; + break; + } + case 3: { + if (message.pypiPackages === $util.emptyObject) + message.pypiPackages = {}; + 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.pypiPackages[key] = value; + break; + } + case 4: { + if (message.envVariables === $util.emptyObject) + message.envVariables = {}; + 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.envVariables[key] = value; + break; + } + case 6: { + message.pythonVersion = reader.string(); + break; + } + case 7: { + message.schedulerCount = reader.int32(); + break; + } + case 8: { + message.cloudDataLineageIntegration = $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwareConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.airflowConfigOverrides != null && message.hasOwnProperty("airflowConfigOverrides")) { + if (!$util.isObject(message.airflowConfigOverrides)) + return "airflowConfigOverrides: object expected"; + var key = Object.keys(message.airflowConfigOverrides); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.airflowConfigOverrides[key[i]])) + return "airflowConfigOverrides: string{k:string} expected"; + } + if (message.pypiPackages != null && message.hasOwnProperty("pypiPackages")) { + if (!$util.isObject(message.pypiPackages)) + return "pypiPackages: object expected"; + var key = Object.keys(message.pypiPackages); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.pypiPackages[key[i]])) + return "pypiPackages: string{k:string} expected"; + } + if (message.envVariables != null && message.hasOwnProperty("envVariables")) { + if (!$util.isObject(message.envVariables)) + return "envVariables: object expected"; + var key = Object.keys(message.envVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.envVariables[key[i]])) + return "envVariables: string{k:string} expected"; + } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + if (!$util.isString(message.pythonVersion)) + return "pythonVersion: string expected"; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + if (!$util.isInteger(message.schedulerCount)) + return "schedulerCount: integer expected"; + if (message.cloudDataLineageIntegration != null && message.hasOwnProperty("cloudDataLineageIntegration")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.verify(message.cloudDataLineageIntegration); + if (error) + return "cloudDataLineageIntegration." + error; + } + return null; + }; + + /** + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} SoftwareConfig + */ + SoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig(); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.airflowConfigOverrides) { + if (typeof object.airflowConfigOverrides !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.airflowConfigOverrides: object expected"); + message.airflowConfigOverrides = {}; + for (var keys = Object.keys(object.airflowConfigOverrides), i = 0; i < keys.length; ++i) + message.airflowConfigOverrides[keys[i]] = String(object.airflowConfigOverrides[keys[i]]); + } + if (object.pypiPackages) { + if (typeof object.pypiPackages !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.pypiPackages: object expected"); + message.pypiPackages = {}; + for (var keys = Object.keys(object.pypiPackages), i = 0; i < keys.length; ++i) + message.pypiPackages[keys[i]] = String(object.pypiPackages[keys[i]]); + } + if (object.envVariables) { + if (typeof object.envVariables !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.envVariables: object expected"); + message.envVariables = {}; + for (var keys = Object.keys(object.envVariables), i = 0; i < keys.length; ++i) + message.envVariables[keys[i]] = String(object.envVariables[keys[i]]); + } + if (object.pythonVersion != null) + message.pythonVersion = String(object.pythonVersion); + if (object.schedulerCount != null) + message.schedulerCount = object.schedulerCount | 0; + if (object.cloudDataLineageIntegration != null) { + if (typeof object.cloudDataLineageIntegration !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig.cloudDataLineageIntegration: object expected"); + message.cloudDataLineageIntegration = $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.fromObject(object.cloudDataLineageIntegration); + } + return message; + }; + + /** + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig} message SoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.airflowConfigOverrides = {}; + object.pypiPackages = {}; + object.envVariables = {}; + } + if (options.defaults) { + object.imageVersion = ""; + object.pythonVersion = ""; + object.schedulerCount = 0; + object.cloudDataLineageIntegration = null; + } + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + var keys2; + if (message.airflowConfigOverrides && (keys2 = Object.keys(message.airflowConfigOverrides)).length) { + object.airflowConfigOverrides = {}; + for (var j = 0; j < keys2.length; ++j) + object.airflowConfigOverrides[keys2[j]] = message.airflowConfigOverrides[keys2[j]]; + } + if (message.pypiPackages && (keys2 = Object.keys(message.pypiPackages)).length) { + object.pypiPackages = {}; + for (var j = 0; j < keys2.length; ++j) + object.pypiPackages[keys2[j]] = message.pypiPackages[keys2[j]]; + } + if (message.envVariables && (keys2 = Object.keys(message.envVariables)).length) { + object.envVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.envVariables[keys2[j]] = message.envVariables[keys2[j]]; + } + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + object.pythonVersion = message.pythonVersion; + if (message.schedulerCount != null && message.hasOwnProperty("schedulerCount")) + object.schedulerCount = message.schedulerCount; + if (message.cloudDataLineageIntegration != null && message.hasOwnProperty("cloudDataLineageIntegration")) + object.cloudDataLineageIntegration = $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.toObject(message.cloudDataLineageIntegration, options); + return object; + }; + + /** + * Converts this SoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + SoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.SoftwareConfig"; + }; + + return SoftwareConfig; + })(); + + v1beta1.IPAllocationPolicy = (function() { + + /** + * Properties of a IPAllocationPolicy. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IIPAllocationPolicy + * @property {boolean|null} [useIpAliases] IPAllocationPolicy useIpAliases + * @property {string|null} [clusterSecondaryRangeName] IPAllocationPolicy clusterSecondaryRangeName + * @property {string|null} [servicesSecondaryRangeName] IPAllocationPolicy servicesSecondaryRangeName + * @property {string|null} [clusterIpv4CidrBlock] IPAllocationPolicy clusterIpv4CidrBlock + * @property {string|null} [servicesIpv4CidrBlock] IPAllocationPolicy servicesIpv4CidrBlock + */ + + /** + * Constructs a new IPAllocationPolicy. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a IPAllocationPolicy. + * @implements IIPAllocationPolicy + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy=} [properties] Properties to set + */ + function IPAllocationPolicy(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]]; + } + + /** + * IPAllocationPolicy useIpAliases. + * @member {boolean} useIpAliases + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.useIpAliases = false; + + /** + * IPAllocationPolicy clusterSecondaryRangeName. + * @member {string} clusterSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.clusterSecondaryRangeName = ""; + + /** + * IPAllocationPolicy servicesSecondaryRangeName. + * @member {string} servicesSecondaryRangeName + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.servicesSecondaryRangeName = ""; + + /** + * IPAllocationPolicy clusterIpv4CidrBlock. + * @member {string} clusterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.clusterIpv4CidrBlock = ""; + + /** + * IPAllocationPolicy servicesIpv4CidrBlock. + * @member {string} servicesIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + */ + IPAllocationPolicy.prototype.servicesIpv4CidrBlock = ""; + + /** + * Creates a new IPAllocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy instance + */ + IPAllocationPolicy.create = function create(properties) { + return new IPAllocationPolicy(properties); + }; + + /** + * Encodes the specified IPAllocationPolicy message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IPAllocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useIpAliases != null && Object.hasOwnProperty.call(message, "useIpAliases")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useIpAliases); + if (message.clusterSecondaryRangeName != null && Object.hasOwnProperty.call(message, "clusterSecondaryRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterSecondaryRangeName); + if (message.servicesSecondaryRangeName != null && Object.hasOwnProperty.call(message, "servicesSecondaryRangeName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.servicesSecondaryRangeName); + if (message.clusterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "clusterIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterIpv4CidrBlock); + if (message.servicesIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "servicesIpv4CidrBlock")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.servicesIpv4CidrBlock); + return writer; + }; + + /** + * Encodes the specified IPAllocationPolicy message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy} message IPAllocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IPAllocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IPAllocationPolicy.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.orchestration.airflow.service.v1beta1.IPAllocationPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useIpAliases = reader.bool(); + break; + } + case 2: { + message.clusterSecondaryRangeName = reader.string(); + break; + } + case 3: { + message.servicesSecondaryRangeName = reader.string(); + break; + } + case 4: { + message.clusterIpv4CidrBlock = reader.string(); + break; + } + case 5: { + message.servicesIpv4CidrBlock = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IPAllocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IPAllocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IPAllocationPolicy message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IPAllocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + if (typeof message.useIpAliases !== "boolean") + return "useIpAliases: boolean expected"; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) + if (!$util.isString(message.clusterSecondaryRangeName)) + return "clusterSecondaryRangeName: string expected"; + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) + if (!$util.isString(message.servicesSecondaryRangeName)) + return "servicesSecondaryRangeName: string expected"; + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) + if (!$util.isString(message.clusterIpv4CidrBlock)) + return "clusterIpv4CidrBlock: string expected"; + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) + if (!$util.isString(message.servicesIpv4CidrBlock)) + return "servicesIpv4CidrBlock: string expected"; + return null; + }; + + /** + * Creates a IPAllocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} IPAllocationPolicy + */ + IPAllocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy(); + if (object.useIpAliases != null) + message.useIpAliases = Boolean(object.useIpAliases); + if (object.clusterSecondaryRangeName != null) + message.clusterSecondaryRangeName = String(object.clusterSecondaryRangeName); + if (object.servicesSecondaryRangeName != null) + message.servicesSecondaryRangeName = String(object.servicesSecondaryRangeName); + if (object.clusterIpv4CidrBlock != null) + message.clusterIpv4CidrBlock = String(object.clusterIpv4CidrBlock); + if (object.servicesIpv4CidrBlock != null) + message.servicesIpv4CidrBlock = String(object.servicesIpv4CidrBlock); + return message; + }; + + /** + * Creates a plain object from a IPAllocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy} message IPAllocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IPAllocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.useIpAliases = false; + object.clusterSecondaryRangeName = ""; + object.servicesSecondaryRangeName = ""; + object.clusterIpv4CidrBlock = ""; + object.servicesIpv4CidrBlock = ""; + } + if (message.useIpAliases != null && message.hasOwnProperty("useIpAliases")) + object.useIpAliases = message.useIpAliases; + if (message.clusterSecondaryRangeName != null && message.hasOwnProperty("clusterSecondaryRangeName")) + object.clusterSecondaryRangeName = message.clusterSecondaryRangeName; + if (message.servicesSecondaryRangeName != null && message.hasOwnProperty("servicesSecondaryRangeName")) + object.servicesSecondaryRangeName = message.servicesSecondaryRangeName; + if (message.clusterIpv4CidrBlock != null && message.hasOwnProperty("clusterIpv4CidrBlock")) + object.clusterIpv4CidrBlock = message.clusterIpv4CidrBlock; + if (message.servicesIpv4CidrBlock != null && message.hasOwnProperty("servicesIpv4CidrBlock")) + object.servicesIpv4CidrBlock = message.servicesIpv4CidrBlock; + return object; + }; + + /** + * Converts this IPAllocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @instance + * @returns {Object.} JSON object + */ + IPAllocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IPAllocationPolicy + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IPAllocationPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy"; + }; + + return IPAllocationPolicy; + })(); + + v1beta1.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface INodeConfig + * @property {string|null} [location] NodeConfig location + * @property {string|null} [machineType] NodeConfig machineType + * @property {string|null} [network] NodeConfig network + * @property {string|null} [subnetwork] NodeConfig subnetwork + * @property {number|null} [diskSizeGb] NodeConfig diskSizeGb + * @property {Array.|null} [oauthScopes] NodeConfig oauthScopes + * @property {string|null} [serviceAccount] NodeConfig serviceAccount + * @property {Array.|null} [tags] NodeConfig tags + * @property {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null} [ipAllocationPolicy] NodeConfig ipAllocationPolicy + * @property {number|null} [maxPodsPerNode] NodeConfig maxPodsPerNode + * @property {boolean|null} [enableIpMasqAgent] NodeConfig enableIpMasqAgent + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(properties) { + this.oauthScopes = []; + this.tags = []; + 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]]; + } + + /** + * NodeConfig location. + * @member {string} location + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.location = ""; + + /** + * NodeConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.machineType = ""; + + /** + * NodeConfig network. + * @member {string} network + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.network = ""; + + /** + * NodeConfig subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.subnetwork = ""; + + /** + * NodeConfig diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.diskSizeGb = 0; + + /** + * NodeConfig oauthScopes. + * @member {Array.} oauthScopes + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.oauthScopes = $util.emptyArray; + + /** + * NodeConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.serviceAccount = ""; + + /** + * NodeConfig tags. + * @member {Array.} tags + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.tags = $util.emptyArray; + + /** + * NodeConfig ipAllocationPolicy. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IIPAllocationPolicy|null|undefined} ipAllocationPolicy + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.ipAllocationPolicy = null; + + /** + * NodeConfig maxPodsPerNode. + * @member {number} maxPodsPerNode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.maxPodsPerNode = 0; + + /** + * NodeConfig enableIpMasqAgent. + * @member {boolean} enableIpMasqAgent + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + */ + NodeConfig.prototype.enableIpMasqAgent = false; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.machineType); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subnetwork); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.diskSizeGb); + if (message.oauthScopes != null && message.oauthScopes.length) + for (var i = 0; i < message.oauthScopes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.oauthScopes[i]); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.serviceAccount); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tags[i]); + if (message.ipAllocationPolicy != null && Object.hasOwnProperty.call(message, "ipAllocationPolicy")) + $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.encode(message.ipAllocationPolicy, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.maxPodsPerNode != null && Object.hasOwnProperty.call(message, "maxPodsPerNode")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.maxPodsPerNode); + if (message.enableIpMasqAgent != null && Object.hasOwnProperty.call(message, "enableIpMasqAgent")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableIpMasqAgent); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.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.orchestration.airflow.service.v1beta1.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.machineType = reader.string(); + break; + } + case 3: { + message.network = reader.string(); + break; + } + case 4: { + message.subnetwork = reader.string(); + break; + } + case 5: { + message.diskSizeGb = reader.int32(); + break; + } + case 6: { + if (!(message.oauthScopes && message.oauthScopes.length)) + message.oauthScopes = []; + message.oauthScopes.push(reader.string()); + break; + } + case 7: { + message.serviceAccount = reader.string(); + break; + } + case 8: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 9: { + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.decode(reader, reader.uint32()); + break; + } + case 10: { + message.maxPodsPerNode = reader.int32(); + break; + } + case 11: { + message.enableIpMasqAgent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.oauthScopes != null && message.hasOwnProperty("oauthScopes")) { + if (!Array.isArray(message.oauthScopes)) + return "oauthScopes: array expected"; + for (var i = 0; i < message.oauthScopes.length; ++i) + if (!$util.isString(message.oauthScopes[i])) + return "oauthScopes: string[] expected"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.verify(message.ipAllocationPolicy); + if (error) + return "ipAllocationPolicy." + error; + } + if (message.maxPodsPerNode != null && message.hasOwnProperty("maxPodsPerNode")) + if (!$util.isInteger(message.maxPodsPerNode)) + return "maxPodsPerNode: integer expected"; + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + if (typeof message.enableIpMasqAgent !== "boolean") + return "enableIpMasqAgent: boolean expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.NodeConfig(); + if (object.location != null) + message.location = String(object.location); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.oauthScopes) { + if (!Array.isArray(object.oauthScopes)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.oauthScopes: array expected"); + message.oauthScopes = []; + for (var i = 0; i < object.oauthScopes.length; ++i) + message.oauthScopes[i] = String(object.oauthScopes[i]); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.ipAllocationPolicy != null) { + if (typeof object.ipAllocationPolicy !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.NodeConfig.ipAllocationPolicy: object expected"); + message.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.fromObject(object.ipAllocationPolicy); + } + if (object.maxPodsPerNode != null) + message.maxPodsPerNode = object.maxPodsPerNode | 0; + if (object.enableIpMasqAgent != null) + message.enableIpMasqAgent = Boolean(object.enableIpMasqAgent); + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.oauthScopes = []; + object.tags = []; + } + if (options.defaults) { + object.location = ""; + object.machineType = ""; + object.network = ""; + object.subnetwork = ""; + object.diskSizeGb = 0; + object.serviceAccount = ""; + object.ipAllocationPolicy = null; + object.maxPodsPerNode = 0; + object.enableIpMasqAgent = false; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.oauthScopes && message.oauthScopes.length) { + object.oauthScopes = []; + for (var j = 0; j < message.oauthScopes.length; ++j) + object.oauthScopes[j] = message.oauthScopes[j]; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.ipAllocationPolicy != null && message.hasOwnProperty("ipAllocationPolicy")) + object.ipAllocationPolicy = $root.google.cloud.orchestration.airflow.service.v1beta1.IPAllocationPolicy.toObject(message.ipAllocationPolicy, options); + if (message.maxPodsPerNode != null && message.hasOwnProperty("maxPodsPerNode")) + object.maxPodsPerNode = message.maxPodsPerNode; + if (message.enableIpMasqAgent != null && message.hasOwnProperty("enableIpMasqAgent")) + object.enableIpMasqAgent = message.enableIpMasqAgent; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.NodeConfig"; + }; + + return NodeConfig; + })(); + + v1beta1.PrivateClusterConfig = (function() { + + /** + * Properties of a PrivateClusterConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IPrivateClusterConfig + * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint + * @property {string|null} [masterIpv4CidrBlock] PrivateClusterConfig masterIpv4CidrBlock + * @property {string|null} [masterIpv4ReservedRange] PrivateClusterConfig masterIpv4ReservedRange + */ + + /** + * Constructs a new PrivateClusterConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a PrivateClusterConfig. + * @implements IPrivateClusterConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig=} [properties] Properties to set + */ + function PrivateClusterConfig(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]]; + } + + /** + * PrivateClusterConfig enablePrivateEndpoint. + * @member {boolean} enablePrivateEndpoint + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.enablePrivateEndpoint = false; + + /** + * PrivateClusterConfig masterIpv4CidrBlock. + * @member {string} masterIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.masterIpv4CidrBlock = ""; + + /** + * PrivateClusterConfig masterIpv4ReservedRange. + * @member {string} masterIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.masterIpv4ReservedRange = ""; + + /** + * Creates a new PrivateClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig instance + */ + PrivateClusterConfig.create = function create(properties) { + return new PrivateClusterConfig(properties); + }; + + /** + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); + if (message.masterIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "masterIpv4CidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.masterIpv4CidrBlock); + if (message.masterIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "masterIpv4ReservedRange")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterIpv4ReservedRange); + return writer; + }; + + /** + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.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.orchestration.airflow.service.v1beta1.PrivateClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enablePrivateEndpoint = reader.bool(); + break; + } + case 2: { + message.masterIpv4CidrBlock = reader.string(); + break; + } + case 3: { + message.masterIpv4ReservedRange = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateClusterConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + if (typeof message.enablePrivateEndpoint !== "boolean") + return "enablePrivateEndpoint: boolean expected"; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + if (!$util.isString(message.masterIpv4CidrBlock)) + return "masterIpv4CidrBlock: string expected"; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + if (!$util.isString(message.masterIpv4ReservedRange)) + return "masterIpv4ReservedRange: string expected"; + return null; + }; + + /** + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} PrivateClusterConfig + */ + PrivateClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig(); + if (object.enablePrivateEndpoint != null) + message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); + if (object.masterIpv4CidrBlock != null) + message.masterIpv4CidrBlock = String(object.masterIpv4CidrBlock); + if (object.masterIpv4ReservedRange != null) + message.masterIpv4ReservedRange = String(object.masterIpv4ReservedRange); + return message; + }; + + /** + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig} message PrivateClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePrivateEndpoint = false; + object.masterIpv4CidrBlock = ""; + object.masterIpv4ReservedRange = ""; + } + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + object.enablePrivateEndpoint = message.enablePrivateEndpoint; + if (message.masterIpv4CidrBlock != null && message.hasOwnProperty("masterIpv4CidrBlock")) + object.masterIpv4CidrBlock = message.masterIpv4CidrBlock; + if (message.masterIpv4ReservedRange != null && message.hasOwnProperty("masterIpv4ReservedRange")) + object.masterIpv4ReservedRange = message.masterIpv4ReservedRange; + return object; + }; + + /** + * Converts this PrivateClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @instance + * @returns {Object.} JSON object + */ + PrivateClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateClusterConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig"; + }; + + return PrivateClusterConfig; + })(); + + v1beta1.NetworkingConfig = (function() { + + /** + * Properties of a NetworkingConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface INetworkingConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType|null} [connectionType] NetworkingConfig connectionType + */ + + /** + * Constructs a new NetworkingConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a NetworkingConfig. + * @implements INetworkingConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig=} [properties] Properties to set + */ + function NetworkingConfig(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]]; + } + + /** + * NetworkingConfig connectionType. + * @member {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType} connectionType + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @instance + */ + NetworkingConfig.prototype.connectionType = 0; + + /** + * Creates a new NetworkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig} NetworkingConfig instance + */ + NetworkingConfig.create = function create(properties) { + return new NetworkingConfig(properties); + }; + + /** + * Encodes the specified NetworkingConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.connectionType); + return writer; + }; + + /** + * Encodes the specified NetworkingConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig} message NetworkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig} NetworkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkingConfig.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.orchestration.airflow.service.v1beta1.NetworkingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.connectionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig} NetworkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkingConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + switch (message.connectionType) { + default: + return "connectionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NetworkingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig} NetworkingConfig + */ + NetworkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig(); + switch (object.connectionType) { + default: + if (typeof object.connectionType === "number") { + message.connectionType = object.connectionType; + break; + } + break; + case "CONNECTION_TYPE_UNSPECIFIED": + case 0: + message.connectionType = 0; + break; + case "VPC_PEERING": + case 1: + message.connectionType = 1; + break; + case "PRIVATE_SERVICE_CONNECT": + case 2: + message.connectionType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig} message NetworkingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.connectionType = options.enums === String ? "CONNECTION_TYPE_UNSPECIFIED" : 0; + if (message.connectionType != null && message.hasOwnProperty("connectionType")) + object.connectionType = options.enums === String ? $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType[message.connectionType] : message.connectionType; + return object; + }; + + /** + * Converts this NetworkingConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkingConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig"; + }; + + /** + * ConnectionType enum. + * @name google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.ConnectionType + * @enum {number} + * @property {number} CONNECTION_TYPE_UNSPECIFIED=0 CONNECTION_TYPE_UNSPECIFIED value + * @property {number} VPC_PEERING=1 VPC_PEERING value + * @property {number} PRIVATE_SERVICE_CONNECT=2 PRIVATE_SERVICE_CONNECT value + */ + NetworkingConfig.ConnectionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VPC_PEERING"] = 1; + values[valuesById[2] = "PRIVATE_SERVICE_CONNECT"] = 2; + return values; + })(); + + return NetworkingConfig; + })(); + + v1beta1.PrivateEnvironmentConfig = (function() { + + /** + * Properties of a PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IPrivateEnvironmentConfig + * @property {boolean|null} [enablePrivateEnvironment] PrivateEnvironmentConfig enablePrivateEnvironment + * @property {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null} [privateClusterConfig] PrivateEnvironmentConfig privateClusterConfig + * @property {string|null} [webServerIpv4CidrBlock] PrivateEnvironmentConfig webServerIpv4CidrBlock + * @property {string|null} [cloudSqlIpv4CidrBlock] PrivateEnvironmentConfig cloudSqlIpv4CidrBlock + * @property {string|null} [webServerIpv4ReservedRange] PrivateEnvironmentConfig webServerIpv4ReservedRange + * @property {string|null} [cloudComposerNetworkIpv4CidrBlock] PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock + * @property {string|null} [cloudComposerNetworkIpv4ReservedRange] PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange + * @property {boolean|null} [enablePrivatelyUsedPublicIps] PrivateEnvironmentConfig enablePrivatelyUsedPublicIps + * @property {string|null} [cloudComposerConnectionSubnetwork] PrivateEnvironmentConfig cloudComposerConnectionSubnetwork + * @property {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig|null} [networkingConfig] PrivateEnvironmentConfig networkingConfig + */ + + /** + * Constructs a new PrivateEnvironmentConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a PrivateEnvironmentConfig. + * @implements IPrivateEnvironmentConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig=} [properties] Properties to set + */ + function PrivateEnvironmentConfig(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]]; + } + + /** + * PrivateEnvironmentConfig enablePrivateEnvironment. + * @member {boolean} enablePrivateEnvironment + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.enablePrivateEnvironment = false; + + /** + * PrivateEnvironmentConfig privateClusterConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IPrivateClusterConfig|null|undefined} privateClusterConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.privateClusterConfig = null; + + /** + * PrivateEnvironmentConfig webServerIpv4CidrBlock. + * @member {string} webServerIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.webServerIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig cloudSqlIpv4CidrBlock. + * @member {string} cloudSqlIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudSqlIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig webServerIpv4ReservedRange. + * @member {string} webServerIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.webServerIpv4ReservedRange = ""; + + /** + * PrivateEnvironmentConfig cloudComposerNetworkIpv4CidrBlock. + * @member {string} cloudComposerNetworkIpv4CidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4CidrBlock = ""; + + /** + * PrivateEnvironmentConfig cloudComposerNetworkIpv4ReservedRange. + * @member {string} cloudComposerNetworkIpv4ReservedRange + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerNetworkIpv4ReservedRange = ""; + + /** + * PrivateEnvironmentConfig enablePrivatelyUsedPublicIps. + * @member {boolean} enablePrivatelyUsedPublicIps + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.enablePrivatelyUsedPublicIps = false; + + /** + * PrivateEnvironmentConfig cloudComposerConnectionSubnetwork. + * @member {string} cloudComposerConnectionSubnetwork + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.cloudComposerConnectionSubnetwork = ""; + + /** + * PrivateEnvironmentConfig networkingConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.INetworkingConfig|null|undefined} networkingConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + */ + PrivateEnvironmentConfig.prototype.networkingConfig = null; + + /** + * Creates a new PrivateEnvironmentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig instance + */ + PrivateEnvironmentConfig.create = function create(properties) { + return new PrivateEnvironmentConfig(properties); + }; + + /** + * Encodes the specified PrivateEnvironmentConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateEnvironmentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePrivateEnvironment != null && Object.hasOwnProperty.call(message, "enablePrivateEnvironment")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEnvironment); + if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.webServerIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "webServerIpv4CidrBlock")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.webServerIpv4CidrBlock); + if (message.cloudSqlIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudSqlIpv4CidrBlock")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cloudSqlIpv4CidrBlock); + if (message.webServerIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "webServerIpv4ReservedRange")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.webServerIpv4ReservedRange); + if (message.enablePrivatelyUsedPublicIps != null && Object.hasOwnProperty.call(message, "enablePrivatelyUsedPublicIps")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enablePrivatelyUsedPublicIps); + if (message.cloudComposerNetworkIpv4CidrBlock != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4CidrBlock")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cloudComposerNetworkIpv4CidrBlock); + if (message.cloudComposerNetworkIpv4ReservedRange != null && Object.hasOwnProperty.call(message, "cloudComposerNetworkIpv4ReservedRange")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cloudComposerNetworkIpv4ReservedRange); + if (message.cloudComposerConnectionSubnetwork != null && Object.hasOwnProperty.call(message, "cloudComposerConnectionSubnetwork")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.cloudComposerConnectionSubnetwork); + if (message.networkingConfig != null && Object.hasOwnProperty.call(message, "networkingConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.encode(message.networkingConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivateEnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IPrivateEnvironmentConfig} message PrivateEnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateEnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateEnvironmentConfig.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.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enablePrivateEnvironment = reader.bool(); + break; + } + case 2: { + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.webServerIpv4CidrBlock = reader.string(); + break; + } + case 4: { + message.cloudSqlIpv4CidrBlock = reader.string(); + break; + } + case 5: { + message.webServerIpv4ReservedRange = reader.string(); + break; + } + case 7: { + message.cloudComposerNetworkIpv4CidrBlock = reader.string(); + break; + } + case 8: { + message.cloudComposerNetworkIpv4ReservedRange = reader.string(); + break; + } + case 6: { + message.enablePrivatelyUsedPublicIps = reader.bool(); + break; + } + case 9: { + message.cloudComposerConnectionSubnetwork = reader.string(); + break; + } + case 10: { + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateEnvironmentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateEnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateEnvironmentConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateEnvironmentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + if (typeof message.enablePrivateEnvironment !== "boolean") + return "enablePrivateEnvironment: boolean expected"; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.verify(message.privateClusterConfig); + if (error) + return "privateClusterConfig." + error; + } + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + if (!$util.isString(message.webServerIpv4CidrBlock)) + return "webServerIpv4CidrBlock: string expected"; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + if (!$util.isString(message.cloudSqlIpv4CidrBlock)) + return "cloudSqlIpv4CidrBlock: string expected"; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + if (!$util.isString(message.webServerIpv4ReservedRange)) + return "webServerIpv4ReservedRange: string expected"; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + if (!$util.isString(message.cloudComposerNetworkIpv4CidrBlock)) + return "cloudComposerNetworkIpv4CidrBlock: string expected"; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + if (!$util.isString(message.cloudComposerNetworkIpv4ReservedRange)) + return "cloudComposerNetworkIpv4ReservedRange: string expected"; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + if (typeof message.enablePrivatelyUsedPublicIps !== "boolean") + return "enablePrivatelyUsedPublicIps: boolean expected"; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + if (!$util.isString(message.cloudComposerConnectionSubnetwork)) + return "cloudComposerConnectionSubnetwork: string expected"; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.verify(message.networkingConfig); + if (error) + return "networkingConfig." + error; + } + return null; + }; + + /** + * Creates a PrivateEnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} PrivateEnvironmentConfig + */ + PrivateEnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig(); + if (object.enablePrivateEnvironment != null) + message.enablePrivateEnvironment = Boolean(object.enablePrivateEnvironment); + if (object.privateClusterConfig != null) { + if (typeof object.privateClusterConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.privateClusterConfig: object expected"); + message.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.fromObject(object.privateClusterConfig); + } + if (object.webServerIpv4CidrBlock != null) + message.webServerIpv4CidrBlock = String(object.webServerIpv4CidrBlock); + if (object.cloudSqlIpv4CidrBlock != null) + message.cloudSqlIpv4CidrBlock = String(object.cloudSqlIpv4CidrBlock); + if (object.webServerIpv4ReservedRange != null) + message.webServerIpv4ReservedRange = String(object.webServerIpv4ReservedRange); + if (object.cloudComposerNetworkIpv4CidrBlock != null) + message.cloudComposerNetworkIpv4CidrBlock = String(object.cloudComposerNetworkIpv4CidrBlock); + if (object.cloudComposerNetworkIpv4ReservedRange != null) + message.cloudComposerNetworkIpv4ReservedRange = String(object.cloudComposerNetworkIpv4ReservedRange); + if (object.enablePrivatelyUsedPublicIps != null) + message.enablePrivatelyUsedPublicIps = Boolean(object.enablePrivatelyUsedPublicIps); + if (object.cloudComposerConnectionSubnetwork != null) + message.cloudComposerConnectionSubnetwork = String(object.cloudComposerConnectionSubnetwork); + if (object.networkingConfig != null) { + if (typeof object.networkingConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig.networkingConfig: object expected"); + message.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.fromObject(object.networkingConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrivateEnvironmentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig} message PrivateEnvironmentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateEnvironmentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enablePrivateEnvironment = false; + object.privateClusterConfig = null; + object.webServerIpv4CidrBlock = ""; + object.cloudSqlIpv4CidrBlock = ""; + object.webServerIpv4ReservedRange = ""; + object.enablePrivatelyUsedPublicIps = false; + object.cloudComposerNetworkIpv4CidrBlock = ""; + object.cloudComposerNetworkIpv4ReservedRange = ""; + object.cloudComposerConnectionSubnetwork = ""; + object.networkingConfig = null; + } + if (message.enablePrivateEnvironment != null && message.hasOwnProperty("enablePrivateEnvironment")) + object.enablePrivateEnvironment = message.enablePrivateEnvironment; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) + object.privateClusterConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.PrivateClusterConfig.toObject(message.privateClusterConfig, options); + if (message.webServerIpv4CidrBlock != null && message.hasOwnProperty("webServerIpv4CidrBlock")) + object.webServerIpv4CidrBlock = message.webServerIpv4CidrBlock; + if (message.cloudSqlIpv4CidrBlock != null && message.hasOwnProperty("cloudSqlIpv4CidrBlock")) + object.cloudSqlIpv4CidrBlock = message.cloudSqlIpv4CidrBlock; + if (message.webServerIpv4ReservedRange != null && message.hasOwnProperty("webServerIpv4ReservedRange")) + object.webServerIpv4ReservedRange = message.webServerIpv4ReservedRange; + if (message.enablePrivatelyUsedPublicIps != null && message.hasOwnProperty("enablePrivatelyUsedPublicIps")) + object.enablePrivatelyUsedPublicIps = message.enablePrivatelyUsedPublicIps; + if (message.cloudComposerNetworkIpv4CidrBlock != null && message.hasOwnProperty("cloudComposerNetworkIpv4CidrBlock")) + object.cloudComposerNetworkIpv4CidrBlock = message.cloudComposerNetworkIpv4CidrBlock; + if (message.cloudComposerNetworkIpv4ReservedRange != null && message.hasOwnProperty("cloudComposerNetworkIpv4ReservedRange")) + object.cloudComposerNetworkIpv4ReservedRange = message.cloudComposerNetworkIpv4ReservedRange; + if (message.cloudComposerConnectionSubnetwork != null && message.hasOwnProperty("cloudComposerConnectionSubnetwork")) + object.cloudComposerConnectionSubnetwork = message.cloudComposerConnectionSubnetwork; + if (message.networkingConfig != null && message.hasOwnProperty("networkingConfig")) + object.networkingConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.NetworkingConfig.toObject(message.networkingConfig, options); + return object; + }; + + /** + * Converts this PrivateEnvironmentConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @instance + * @returns {Object.} JSON object + */ + PrivateEnvironmentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateEnvironmentConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateEnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.PrivateEnvironmentConfig"; + }; + + return PrivateEnvironmentConfig; + })(); + + v1beta1.DatabaseConfig = (function() { + + /** + * Properties of a DatabaseConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IDatabaseConfig + * @property {string|null} [machineType] DatabaseConfig machineType + */ + + /** + * Constructs a new DatabaseConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a DatabaseConfig. + * @implements IDatabaseConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig=} [properties] Properties to set + */ + function DatabaseConfig(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]]; + } + + /** + * DatabaseConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @instance + */ + DatabaseConfig.prototype.machineType = ""; + + /** + * Creates a new DatabaseConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig instance + */ + DatabaseConfig.create = function create(properties) { + return new DatabaseConfig(properties); + }; + + /** + * Encodes the specified DatabaseConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified DatabaseConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IDatabaseConfig} message DatabaseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatabaseConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatabaseConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseConfig.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.orchestration.airflow.service.v1beta1.DatabaseConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatabaseConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatabaseConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatabaseConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatabaseConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; + + /** + * Creates a DatabaseConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} DatabaseConfig + */ + DatabaseConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from a DatabaseConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig} message DatabaseConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatabaseConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.machineType = ""; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this DatabaseConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @instance + * @returns {Object.} JSON object + */ + DatabaseConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatabaseConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatabaseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.DatabaseConfig"; + }; + + return DatabaseConfig; + })(); + + v1beta1.WebServerConfig = (function() { + + /** + * Properties of a WebServerConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IWebServerConfig + * @property {string|null} [machineType] WebServerConfig machineType + */ + + /** + * Constructs a new WebServerConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a WebServerConfig. + * @implements IWebServerConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig=} [properties] Properties to set + */ + function WebServerConfig(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]]; + } + + /** + * WebServerConfig machineType. + * @member {string} machineType + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @instance + */ + WebServerConfig.prototype.machineType = ""; + + /** + * Creates a new WebServerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig instance + */ + WebServerConfig.create = function create(properties) { + return new WebServerConfig(properties); + }; + + /** + * Encodes the specified WebServerConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified WebServerConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWebServerConfig} message WebServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebServerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerConfig.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.orchestration.airflow.service.v1beta1.WebServerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebServerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebServerConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + return null; + }; + + /** + * Creates a WebServerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} WebServerConfig + */ + WebServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from a WebServerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig} message WebServerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.machineType = ""; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this WebServerConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @instance + * @returns {Object.} JSON object + */ + WebServerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebServerConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WebServerConfig"; + }; + + return WebServerConfig; + })(); + + v1beta1.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(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]]; + } + + /** + * EncryptionConfig kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.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.orchestration.airflow.service.v1beta1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1beta1.MaintenanceWindow = (function() { + + /** + * Properties of a MaintenanceWindow. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IMaintenanceWindow + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceWindow endTime + * @property {string|null} [recurrence] MaintenanceWindow recurrence + */ + + /** + * Constructs a new MaintenanceWindow. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a MaintenanceWindow. + * @implements IMaintenanceWindow + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow=} [properties] Properties to set + */ + function MaintenanceWindow(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]]; + } + + /** + * MaintenanceWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.startTime = null; + + /** + * MaintenanceWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.endTime = null; + + /** + * MaintenanceWindow recurrence. + * @member {string} recurrence + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @instance + */ + MaintenanceWindow.prototype.recurrence = ""; + + /** + * Creates a new MaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow instance + */ + MaintenanceWindow.create = function create(properties) { + return new MaintenanceWindow(properties); + }; + + /** + * Encodes the specified MaintenanceWindow message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.recurrence != null && Object.hasOwnProperty.call(message, "recurrence")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.recurrence); + return writer; + }; + + /** + * Encodes the specified MaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMaintenanceWindow} message MaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.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.orchestration.airflow.service.v1beta1.MaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.recurrence = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceWindow message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + if (!$util.isString(message.recurrence)) + return "recurrence: string expected"; + return null; + }; + + /** + * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow + */ + MaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.recurrence != null) + message.recurrence = String(object.recurrence); + return message; + }; + + /** + * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} message MaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.recurrence = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.recurrence != null && message.hasOwnProperty("recurrence")) + object.recurrence = message.recurrence; + return object; + }; + + /** + * Converts this MaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + MaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow"; + }; + + return MaintenanceWindow; + })(); + + v1beta1.WorkloadsConfig = (function() { + + /** + * Properties of a WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IWorkloadsConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null} [scheduler] WorkloadsConfig scheduler + * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null} [webServer] WorkloadsConfig webServer + * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null} [worker] WorkloadsConfig worker + * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource|null} [triggerer] WorkloadsConfig triggerer + */ + + /** + * Constructs a new WorkloadsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a WorkloadsConfig. + * @implements IWorkloadsConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig=} [properties] Properties to set + */ + function WorkloadsConfig(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]]; + } + + /** + * WorkloadsConfig scheduler. + * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null|undefined} scheduler + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.scheduler = null; + + /** + * WorkloadsConfig webServer. + * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null|undefined} webServer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.webServer = null; + + /** + * WorkloadsConfig worker. + * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null|undefined} worker + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.worker = null; + + /** + * WorkloadsConfig triggerer. + * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource|null|undefined} triggerer + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @instance + */ + WorkloadsConfig.prototype.triggerer = null; + + /** + * Creates a new WorkloadsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig instance + */ + WorkloadsConfig.create = function create(properties) { + return new WorkloadsConfig(properties); + }; + + /** + * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduler != null && Object.hasOwnProperty.call(message, "scheduler")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.encode(message.scheduler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.webServer != null && Object.hasOwnProperty.call(message, "webServer")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.encode(message.webServer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.worker != null && Object.hasOwnProperty.call(message, "worker")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.encode(message.worker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.triggerer != null && Object.hasOwnProperty.call(message, "triggerer")) + $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.encode(message.triggerer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkloadsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadsConfig.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.orchestration.airflow.service.v1beta1.WorkloadsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.triggerer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkloadsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkloadsConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkloadsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduler != null && message.hasOwnProperty("scheduler")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify(message.scheduler); + if (error) + return "scheduler." + error; + } + if (message.webServer != null && message.hasOwnProperty("webServer")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify(message.webServer); + if (error) + return "webServer." + error; + } + if (message.worker != null && message.hasOwnProperty("worker")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify(message.worker); + if (error) + return "worker." + error; + } + if (message.triggerer != null && message.hasOwnProperty("triggerer")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.verify(message.triggerer); + if (error) + return "triggerer." + error; + } + return null; + }; + + /** + * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig + */ + WorkloadsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig(); + if (object.scheduler != null) { + if (typeof object.scheduler !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.scheduler: object expected"); + message.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.fromObject(object.scheduler); + } + if (object.webServer != null) { + if (typeof object.webServer !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.webServer: object expected"); + message.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.fromObject(object.webServer); + } + if (object.worker != null) { + if (typeof object.worker !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.worker: object expected"); + message.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.fromObject(object.worker); + } + if (object.triggerer != null) { + if (typeof object.triggerer !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.triggerer: object expected"); + message.triggerer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.fromObject(object.triggerer); + } + return message; + }; + + /** + * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} message WorkloadsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkloadsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduler = null; + object.webServer = null; + object.worker = null; + object.triggerer = null; + } + if (message.scheduler != null && message.hasOwnProperty("scheduler")) + object.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.toObject(message.scheduler, options); + if (message.webServer != null && message.hasOwnProperty("webServer")) + object.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.toObject(message.webServer, options); + if (message.worker != null && message.hasOwnProperty("worker")) + object.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.toObject(message.worker, options); + if (message.triggerer != null && message.hasOwnProperty("triggerer")) + object.triggerer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.toObject(message.triggerer, options); + return object; + }; + + /** + * Converts this WorkloadsConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @instance + * @returns {Object.} JSON object + */ + WorkloadsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkloadsConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkloadsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig"; + }; + + WorkloadsConfig.SchedulerResource = (function() { + + /** + * Properties of a SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @interface ISchedulerResource + * @property {number|null} [cpu] SchedulerResource cpu + * @property {number|null} [memoryGb] SchedulerResource memoryGb + * @property {number|null} [storageGb] SchedulerResource storageGb + * @property {number|null} [count] SchedulerResource count + */ + + /** + * Constructs a new SchedulerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @classdesc Represents a SchedulerResource. + * @implements ISchedulerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + */ + function SchedulerResource(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]]; + } + + /** + * SchedulerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.cpu = 0; + + /** + * SchedulerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.memoryGb = 0; + + /** + * SchedulerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.storageGb = 0; + + /** + * SchedulerResource count. + * @member {number} count + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @instance + */ + SchedulerResource.prototype.count = 0; + + /** + * Creates a new SchedulerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource instance + */ + SchedulerResource.create = function create(properties) { + return new SchedulerResource(properties); + }; + + /** + * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); + return writer; + }; + + /** + * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.count = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + return null; + }; + + /** + * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource + */ + SchedulerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.count != null) + message.count = object.count | 0; + return message; + }; + + /** + * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} message SchedulerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.count = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + return object; + }; + + /** + * Converts this SchedulerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @instance + * @returns {Object.} JSON object + */ + SchedulerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource"; + }; + + return SchedulerResource; + })(); + + WorkloadsConfig.WebServerResource = (function() { + + /** + * Properties of a WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @interface IWebServerResource + * @property {number|null} [cpu] WebServerResource cpu + * @property {number|null} [memoryGb] WebServerResource memoryGb + * @property {number|null} [storageGb] WebServerResource storageGb + */ + + /** + * Constructs a new WebServerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @classdesc Represents a WebServerResource. + * @implements IWebServerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + */ + function WebServerResource(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]]; + } + + /** + * WebServerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.cpu = 0; + + /** + * WebServerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.memoryGb = 0; + + /** + * WebServerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @instance + */ + WebServerResource.prototype.storageGb = 0; + + /** + * Creates a new WebServerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource instance + */ + WebServerResource.create = function create(properties) { + return new WebServerResource(properties); + }; + + /** + * Encodes the specified WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + return writer; + }; + + /** + * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebServerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebServerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebServerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebServerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebServerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebServerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + return null; + }; + + /** + * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource + */ + WebServerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + return message; + }; + + /** + * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} message WebServerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebServerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + return object; + }; - /** - * Decodes a MaintenanceWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this WebServerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @instance + * @returns {Object.} JSON object + */ + WebServerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a MaintenanceWindow message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MaintenanceWindow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.recurrence != null && message.hasOwnProperty("recurrence")) - if (!$util.isString(message.recurrence)) - return "recurrence: string expected"; - return null; - }; + /** + * Gets the default type url for WebServerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebServerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource"; + }; - /** - * Creates a MaintenanceWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} MaintenanceWindow - */ - MaintenanceWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.recurrence != null) - message.recurrence = String(object.recurrence); - return message; - }; + return WebServerResource; + })(); - /** - * Creates a plain object from a MaintenanceWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow} message MaintenanceWindow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MaintenanceWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.recurrence = ""; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.recurrence != null && message.hasOwnProperty("recurrence")) - object.recurrence = message.recurrence; - return object; - }; + WorkloadsConfig.WorkerResource = (function() { - /** - * Converts this MaintenanceWindow to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @instance - * @returns {Object.} JSON object - */ - MaintenanceWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @interface IWorkerResource + * @property {number|null} [cpu] WorkerResource cpu + * @property {number|null} [memoryGb] WorkerResource memoryGb + * @property {number|null} [storageGb] WorkerResource storageGb + * @property {number|null} [minCount] WorkerResource minCount + * @property {number|null} [maxCount] WorkerResource maxCount + */ - /** - * Gets the default type url for MaintenanceWindow - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Constructs a new WorkerResource. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig + * @classdesc Represents a WorkerResource. + * @implements IWorkerResource + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + */ + function WorkerResource(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]]; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.MaintenanceWindow"; - }; - - return MaintenanceWindow; - })(); - - v1beta1.WorkloadsConfig = (function() { - /** - * Properties of a WorkloadsConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @interface IWorkloadsConfig - * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null} [scheduler] WorkloadsConfig scheduler - * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null} [webServer] WorkloadsConfig webServer - * @property {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null} [worker] WorkloadsConfig worker - */ + /** + * WorkerResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.cpu = 0; - /** - * Constructs a new WorkloadsConfig. - * @memberof google.cloud.orchestration.airflow.service.v1beta1 - * @classdesc Represents a WorkloadsConfig. - * @implements IWorkloadsConfig - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig=} [properties] Properties to set - */ - function WorkloadsConfig(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]]; - } + /** + * WorkerResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.memoryGb = 0; - /** - * WorkloadsConfig scheduler. - * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource|null|undefined} scheduler - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.scheduler = null; + /** + * WorkerResource storageGb. + * @member {number} storageGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.storageGb = 0; - /** - * WorkloadsConfig webServer. - * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource|null|undefined} webServer - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.webServer = null; + /** + * WorkerResource minCount. + * @member {number} minCount + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.minCount = 0; - /** - * WorkloadsConfig worker. - * @member {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource|null|undefined} worker - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @instance - */ - WorkloadsConfig.prototype.worker = null; + /** + * WorkerResource maxCount. + * @member {number} maxCount + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + */ + WorkerResource.prototype.maxCount = 0; - /** - * Creates a new WorkloadsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig instance - */ - WorkloadsConfig.create = function create(properties) { - return new WorkloadsConfig(properties); - }; + /** + * Creates a new WorkerResource instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource instance + */ + WorkerResource.create = function create(properties) { + return new WorkerResource(properties); + }; - /** - * Encodes the specified WorkloadsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkloadsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduler != null && Object.hasOwnProperty.call(message, "scheduler")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.encode(message.scheduler, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.webServer != null && Object.hasOwnProperty.call(message, "webServer")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.encode(message.webServer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.worker != null && Object.hasOwnProperty.call(message, "worker")) - $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.encode(message.worker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); + if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); + if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minCount); + if (message.maxCount != null && Object.hasOwnProperty.call(message, "maxCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxCount); + return writer; + }; - /** - * Encodes the specified WorkloadsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.IWorkloadsConfig} message WorkloadsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkloadsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a WorkloadsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkloadsConfig.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.orchestration.airflow.service.v1beta1.WorkloadsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.decode(reader, reader.uint32()); - break; - } - case 2: { - message.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.decode(reader, reader.uint32()); + /** + * Decodes a WorkerResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpu = reader.float(); + break; + } + case 2: { + message.memoryGb = reader.float(); + break; + } + case 3: { + message.storageGb = reader.float(); + break; + } + case 4: { + message.minCount = reader.int32(); + break; + } + case 5: { + message.maxCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a WorkloadsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkloadsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a WorkloadsConfig message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkloadsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduler != null && message.hasOwnProperty("scheduler")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify(message.scheduler); - if (error) - return "scheduler." + error; - } - if (message.webServer != null && message.hasOwnProperty("webServer")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify(message.webServer); - if (error) - return "webServer." + error; - } - if (message.worker != null && message.hasOwnProperty("worker")) { - var error = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify(message.worker); - if (error) - return "worker." + error; - } - return null; - }; + /** + * Verifies a WorkerResource message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpu != null && message.hasOwnProperty("cpu")) + if (typeof message.cpu !== "number") + return "cpu: number expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (typeof message.memoryGb !== "number") + return "memoryGb: number expected"; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + if (typeof message.storageGb !== "number") + return "storageGb: number expected"; + if (message.minCount != null && message.hasOwnProperty("minCount")) + if (!$util.isInteger(message.minCount)) + return "minCount: integer expected"; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + if (!$util.isInteger(message.maxCount)) + return "maxCount: integer expected"; + return null; + }; - /** - * Creates a WorkloadsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} WorkloadsConfig - */ - WorkloadsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig) + /** + * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + */ + WorkerResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource(); + if (object.cpu != null) + message.cpu = Number(object.cpu); + if (object.memoryGb != null) + message.memoryGb = Number(object.memoryGb); + if (object.storageGb != null) + message.storageGb = Number(object.storageGb); + if (object.minCount != null) + message.minCount = object.minCount | 0; + if (object.maxCount != null) + message.maxCount = object.maxCount | 0; + return message; + }; + + /** + * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} message WorkerResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpu = 0; + object.memoryGb = 0; + object.storageGb = 0; + object.minCount = 0; + object.maxCount = 0; + } + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + if (message.storageGb != null && message.hasOwnProperty("storageGb")) + object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + if (message.minCount != null && message.hasOwnProperty("minCount")) + object.minCount = message.minCount; + if (message.maxCount != null && message.hasOwnProperty("maxCount")) + object.maxCount = message.maxCount; return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig(); - if (object.scheduler != null) { - if (typeof object.scheduler !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.scheduler: object expected"); - message.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.fromObject(object.scheduler); - } - if (object.webServer != null) { - if (typeof object.webServer !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.webServer: object expected"); - message.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.fromObject(object.webServer); - } - if (object.worker != null) { - if (typeof object.worker !== "object") - throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.worker: object expected"); - message.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.fromObject(object.worker); - } - return message; - }; + }; - /** - * Creates a plain object from a WorkloadsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig} message WorkloadsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkloadsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scheduler = null; - object.webServer = null; - object.worker = null; - } - if (message.scheduler != null && message.hasOwnProperty("scheduler")) - object.scheduler = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.toObject(message.scheduler, options); - if (message.webServer != null && message.hasOwnProperty("webServer")) - object.webServer = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.toObject(message.webServer, options); - if (message.worker != null && message.hasOwnProperty("worker")) - object.worker = $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.toObject(message.worker, options); - return object; - }; + /** + * Converts this WorkerResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @instance + * @returns {Object.} JSON object + */ + WorkerResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this WorkloadsConfig to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @instance - * @returns {Object.} JSON object - */ - WorkloadsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for WorkerResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource"; + }; - /** - * Gets the default type url for WorkloadsConfig - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkloadsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig"; - }; + return WorkerResource; + })(); - WorkloadsConfig.SchedulerResource = (function() { + WorkloadsConfig.TriggererResource = (function() { /** - * Properties of a SchedulerResource. + * Properties of a TriggererResource. * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @interface ISchedulerResource - * @property {number|null} [cpu] SchedulerResource cpu - * @property {number|null} [memoryGb] SchedulerResource memoryGb - * @property {number|null} [storageGb] SchedulerResource storageGb - * @property {number|null} [count] SchedulerResource count + * @interface ITriggererResource + * @property {number|null} [count] TriggererResource count + * @property {number|null} [cpu] TriggererResource cpu + * @property {number|null} [memoryGb] TriggererResource memoryGb */ /** - * Constructs a new SchedulerResource. + * Constructs a new TriggererResource. * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @classdesc Represents a SchedulerResource. - * @implements ISchedulerResource + * @classdesc Represents a TriggererResource. + * @implements ITriggererResource * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource=} [properties] Properties to set */ - function SchedulerResource(properties) { + function TriggererResource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12955,117 +20137,103 @@ } /** - * SchedulerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource - * @instance - */ - SchedulerResource.prototype.cpu = 0; - - /** - * SchedulerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * TriggererResource count. + * @member {number} count + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @instance */ - SchedulerResource.prototype.memoryGb = 0; + TriggererResource.prototype.count = 0; /** - * SchedulerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * TriggererResource cpu. + * @member {number} cpu + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @instance */ - SchedulerResource.prototype.storageGb = 0; + TriggererResource.prototype.cpu = 0; /** - * SchedulerResource count. - * @member {number} count - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * TriggererResource memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @instance */ - SchedulerResource.prototype.count = 0; + TriggererResource.prototype.memoryGb = 0; /** - * Creates a new SchedulerResource instance using the specified properties. + * Creates a new TriggererResource instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource} TriggererResource instance */ - SchedulerResource.create = function create(properties) { - return new SchedulerResource(properties); + TriggererResource.create = function create(properties) { + return new TriggererResource(properties); }; /** - * Encodes the specified SchedulerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * Encodes the specified TriggererResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource} message TriggererResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SchedulerResource.encode = function encode(message, writer) { + TriggererResource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); + writer.uint32(/* id 2, wireType 5 =*/21).float(message.cpu); if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); + writer.uint32(/* id 3, wireType 5 =*/29).float(message.memoryGb); return writer; }; /** - * Encodes the specified SchedulerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource.verify|verify} messages. + * Encodes the specified TriggererResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ISchedulerResource} message SchedulerResource message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.ITriggererResource} message TriggererResource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SchedulerResource.encodeDelimited = function encodeDelimited(message, writer) { + TriggererResource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SchedulerResource message from the specified reader or buffer. + * Decodes a TriggererResource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource} TriggererResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SchedulerResource.decode = function decode(reader, length) { + TriggererResource.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cpu = reader.float(); + message.count = reader.int32(); break; } case 2: { - message.memoryGb = reader.float(); + message.cpu = reader.float(); break; } case 3: { - message.storageGb = reader.float(); - break; - } - case 4: { - message.count = reader.int32(); + message.memoryGb = reader.float(); break; } default: @@ -13077,401 +20245,869 @@ }; /** - * Decodes a SchedulerResource message from the specified reader or buffer, length delimited. + * Decodes a TriggererResource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource} TriggererResource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SchedulerResource.decodeDelimited = function decodeDelimited(reader) { + TriggererResource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SchedulerResource message. + * Verifies a TriggererResource message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SchedulerResource.verify = function verify(message) { + TriggererResource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; if (message.cpu != null && message.hasOwnProperty("cpu")) if (typeof message.cpu !== "number") return "cpu: number expected"; if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) if (typeof message.memoryGb !== "number") return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; return null; }; /** - * Creates a SchedulerResource message from a plain object. Also converts values to their respective internal types. + * Creates a TriggererResource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} SchedulerResource - */ - SchedulerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource) + * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource} TriggererResource + */ + TriggererResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource(); + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource(); + if (object.count != null) + message.count = object.count | 0; if (object.cpu != null) message.cpu = Number(object.cpu); if (object.memoryGb != null) message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - if (object.count != null) - message.count = object.count | 0; return message; }; /** - * Creates a plain object from a SchedulerResource message. Also converts values to other types if specified. + * Creates a plain object from a TriggererResource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource} message SchedulerResource + * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource} message TriggererResource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SchedulerResource.toObject = function toObject(message, options) { + TriggererResource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + object.count = 0; object.cpu = 0; object.memoryGb = 0; - object.storageGb = 0; - object.count = 0; } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - return object; - }; + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.cpu != null && message.hasOwnProperty("cpu")) + object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; + return object; + }; + + /** + * Converts this TriggererResource to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource + * @instance + * @returns {Object.} JSON object + */ + TriggererResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggererResource + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggererResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.TriggererResource"; + }; + + return TriggererResource; + })(); + + return WorkloadsConfig; + })(); + + v1beta1.RecoveryConfig = (function() { + + /** + * Properties of a RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IRecoveryConfig + * @property {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig|null} [scheduledSnapshotsConfig] RecoveryConfig scheduledSnapshotsConfig + */ + + /** + * Constructs a new RecoveryConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a RecoveryConfig. + * @implements IRecoveryConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig=} [properties] Properties to set + */ + function RecoveryConfig(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]]; + } + + /** + * RecoveryConfig scheduledSnapshotsConfig. + * @member {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig|null|undefined} scheduledSnapshotsConfig + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @instance + */ + RecoveryConfig.prototype.scheduledSnapshotsConfig = null; + + /** + * Creates a new RecoveryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig} RecoveryConfig instance + */ + RecoveryConfig.create = function create(properties) { + return new RecoveryConfig(properties); + }; + + /** + * Encodes the specified RecoveryConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledSnapshotsConfig != null && Object.hasOwnProperty.call(message, "scheduledSnapshotsConfig")) + $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.encode(message.scheduledSnapshotsConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RecoveryConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IRecoveryConfig} message RecoveryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecoveryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.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.orchestration.airflow.service.v1beta1.RecoveryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecoveryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig} RecoveryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecoveryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecoveryConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecoveryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.verify(message.scheduledSnapshotsConfig); + if (error) + return "scheduledSnapshotsConfig." + error; + } + return null; + }; + + /** + * Creates a RecoveryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig} RecoveryConfig + */ + RecoveryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig(); + if (object.scheduledSnapshotsConfig != null) { + if (typeof object.scheduledSnapshotsConfig !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig.scheduledSnapshotsConfig: object expected"); + message.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.fromObject(object.scheduledSnapshotsConfig); + } + return message; + }; + + /** + * Creates a plain object from a RecoveryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig} message RecoveryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecoveryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.scheduledSnapshotsConfig = null; + if (message.scheduledSnapshotsConfig != null && message.hasOwnProperty("scheduledSnapshotsConfig")) + object.scheduledSnapshotsConfig = $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.toObject(message.scheduledSnapshotsConfig, options); + return object; + }; + + /** + * Converts this RecoveryConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @instance + * @returns {Object.} JSON object + */ + RecoveryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecoveryConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecoveryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.RecoveryConfig"; + }; + + return RecoveryConfig; + })(); + + v1beta1.ScheduledSnapshotsConfig = (function() { + + /** + * Properties of a ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IScheduledSnapshotsConfig + * @property {boolean|null} [enabled] ScheduledSnapshotsConfig enabled + * @property {string|null} [snapshotLocation] ScheduledSnapshotsConfig snapshotLocation + * @property {string|null} [snapshotCreationSchedule] ScheduledSnapshotsConfig snapshotCreationSchedule + * @property {string|null} [timeZone] ScheduledSnapshotsConfig timeZone + */ + + /** + * Constructs a new ScheduledSnapshotsConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a ScheduledSnapshotsConfig. + * @implements IScheduledSnapshotsConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig=} [properties] Properties to set + */ + function ScheduledSnapshotsConfig(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]]; + } + + /** + * ScheduledSnapshotsConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.enabled = false; + + /** + * ScheduledSnapshotsConfig snapshotLocation. + * @member {string} snapshotLocation + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.snapshotLocation = ""; + + /** + * ScheduledSnapshotsConfig snapshotCreationSchedule. + * @member {string} snapshotCreationSchedule + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.snapshotCreationSchedule = ""; + + /** + * ScheduledSnapshotsConfig timeZone. + * @member {string} timeZone + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @instance + */ + ScheduledSnapshotsConfig.prototype.timeZone = ""; + + /** + * Creates a new ScheduledSnapshotsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig instance + */ + ScheduledSnapshotsConfig.create = function create(properties) { + return new ScheduledSnapshotsConfig(properties); + }; + + /** + * Encodes the specified ScheduledSnapshotsConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledSnapshotsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.snapshotCreationSchedule != null && Object.hasOwnProperty.call(message, "snapshotCreationSchedule")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshotCreationSchedule); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.snapshotLocation != null && Object.hasOwnProperty.call(message, "snapshotLocation")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.snapshotLocation); + return writer; + }; + + /** + * Encodes the specified ScheduledSnapshotsConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IScheduledSnapshotsConfig} message ScheduledSnapshotsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduledSnapshotsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledSnapshotsConfig.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.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 6: { + message.snapshotLocation = reader.string(); + break; + } + case 3: { + message.snapshotCreationSchedule = reader.string(); + break; + } + case 5: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this SchedulerResource to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource - * @instance - * @returns {Object.} JSON object - */ - SchedulerResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ScheduledSnapshotsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduledSnapshotsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for SchedulerResource - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchedulerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.SchedulerResource"; - }; + /** + * Verifies a ScheduledSnapshotsConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduledSnapshotsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + if (!$util.isString(message.snapshotLocation)) + return "snapshotLocation: string expected"; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + if (!$util.isString(message.snapshotCreationSchedule)) + return "snapshotCreationSchedule: string expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; - return SchedulerResource; - })(); + /** + * Creates a ScheduledSnapshotsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig} ScheduledSnapshotsConfig + */ + ScheduledSnapshotsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.snapshotLocation != null) + message.snapshotLocation = String(object.snapshotLocation); + if (object.snapshotCreationSchedule != null) + message.snapshotCreationSchedule = String(object.snapshotCreationSchedule); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; - WorkloadsConfig.WebServerResource = (function() { + /** + * Creates a plain object from a ScheduledSnapshotsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig} message ScheduledSnapshotsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduledSnapshotsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.snapshotCreationSchedule = ""; + object.timeZone = ""; + object.snapshotLocation = ""; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.snapshotCreationSchedule != null && message.hasOwnProperty("snapshotCreationSchedule")) + object.snapshotCreationSchedule = message.snapshotCreationSchedule; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.snapshotLocation != null && message.hasOwnProperty("snapshotLocation")) + object.snapshotLocation = message.snapshotLocation; + return object; + }; - /** - * Properties of a WebServerResource. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @interface IWebServerResource - * @property {number|null} [cpu] WebServerResource cpu - * @property {number|null} [memoryGb] WebServerResource memoryGb - * @property {number|null} [storageGb] WebServerResource storageGb - */ + /** + * Converts this ScheduledSnapshotsConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @instance + * @returns {Object.} JSON object + */ + ScheduledSnapshotsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new WebServerResource. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @classdesc Represents a WebServerResource. - * @implements IWebServerResource - * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set - */ - function WebServerResource(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]]; + /** + * Gets the default type url for ScheduledSnapshotsConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduledSnapshotsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.ScheduledSnapshotsConfig"; + }; - /** - * WebServerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.cpu = 0; + return ScheduledSnapshotsConfig; + })(); - /** - * WebServerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.memoryGb = 0; + v1beta1.MasterAuthorizedNetworksConfig = (function() { - /** - * WebServerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @instance - */ - WebServerResource.prototype.storageGb = 0; + /** + * Properties of a MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface IMasterAuthorizedNetworksConfig + * @property {boolean|null} [enabled] MasterAuthorizedNetworksConfig enabled + * @property {Array.|null} [cidrBlocks] MasterAuthorizedNetworksConfig cidrBlocks + */ - /** - * Creates a new WebServerResource instance using the specified properties. - * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource instance - */ - WebServerResource.create = function create(properties) { - return new WebServerResource(properties); - }; + /** + * Constructs a new MasterAuthorizedNetworksConfig. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a MasterAuthorizedNetworksConfig. + * @implements IMasterAuthorizedNetworksConfig + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + */ + function MasterAuthorizedNetworksConfig(properties) { + this.cidrBlocks = []; + 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 WebServerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - return writer; - }; + /** + * MasterAuthorizedNetworksConfig enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @instance + */ + MasterAuthorizedNetworksConfig.prototype.enabled = false; - /** - * Encodes the specified WebServerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWebServerResource} message WebServerResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebServerResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * MasterAuthorizedNetworksConfig cidrBlocks. + * @member {Array.} cidrBlocks + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @instance + */ + MasterAuthorizedNetworksConfig.prototype.cidrBlocks = $util.emptyArray; - /** - * Decodes a WebServerResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerResource.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpu = reader.float(); - break; - } - case 2: { - message.memoryGb = reader.float(); - break; - } - case 3: { - message.storageGb = reader.float(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Creates a new MasterAuthorizedNetworksConfig instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig instance + */ + MasterAuthorizedNetworksConfig.create = function create(properties) { + return new MasterAuthorizedNetworksConfig(properties); + }; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasterAuthorizedNetworksConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.cidrBlocks != null && message.cidrBlocks.length) + for (var i = 0; i < message.cidrBlocks.length; ++i) + $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.encode(message.cidrBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MasterAuthorizedNetworksConfig message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.IMasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MasterAuthorizedNetworksConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasterAuthorizedNetworksConfig.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.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + if (!(message.cidrBlocks && message.cidrBlocks.length)) + message.cidrBlocks = []; + message.cidrBlocks.push($root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.decode(reader, reader.uint32())); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a WebServerResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebServerResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WebServerResource message. - * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebServerResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cpu != null && message.hasOwnProperty("cpu")) - if (typeof message.cpu !== "number") - return "cpu: number expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (typeof message.memoryGb !== "number") - return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - return null; - }; + } + return message; + }; - /** - * Creates a WebServerResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} WebServerResource - */ - WebServerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource) - return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource(); - if (object.cpu != null) - message.cpu = Number(object.cpu); - if (object.memoryGb != null) - message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - return message; - }; + /** + * Decodes a MasterAuthorizedNetworksConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MasterAuthorizedNetworksConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a WebServerResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource} message WebServerResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebServerResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpu = 0; - object.memoryGb = 0; - object.storageGb = 0; + /** + * Verifies a MasterAuthorizedNetworksConfig message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MasterAuthorizedNetworksConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.cidrBlocks != null && message.hasOwnProperty("cidrBlocks")) { + if (!Array.isArray(message.cidrBlocks)) + return "cidrBlocks: array expected"; + for (var i = 0; i < message.cidrBlocks.length; ++i) { + var error = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.verify(message.cidrBlocks[i]); + if (error) + return "cidrBlocks." + error; } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; + } + return null; + }; + + /** + * Creates a MasterAuthorizedNetworksConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig} MasterAuthorizedNetworksConfig + */ + MasterAuthorizedNetworksConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig) return object; - }; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.cidrBlocks) { + if (!Array.isArray(object.cidrBlocks)) + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.cidrBlocks: array expected"); + message.cidrBlocks = []; + for (var i = 0; i < object.cidrBlocks.length; ++i) { + if (typeof object.cidrBlocks[i] !== "object") + throw TypeError(".google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.cidrBlocks: object expected"); + message.cidrBlocks[i] = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.fromObject(object.cidrBlocks[i]); + } + } + return message; + }; - /** - * Converts this WebServerResource to JSON. - * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @instance - * @returns {Object.} JSON object - */ - WebServerResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a MasterAuthorizedNetworksConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig} message MasterAuthorizedNetworksConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MasterAuthorizedNetworksConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cidrBlocks = []; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.cidrBlocks && message.cidrBlocks.length) { + object.cidrBlocks = []; + for (var j = 0; j < message.cidrBlocks.length; ++j) + object.cidrBlocks[j] = $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.toObject(message.cidrBlocks[j], options); + } + return object; + }; - /** - * Gets the default type url for WebServerResource - * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WebServerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WebServerResource"; - }; + /** + * Converts this MasterAuthorizedNetworksConfig to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @instance + * @returns {Object.} JSON object + */ + MasterAuthorizedNetworksConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return WebServerResource; - })(); + /** + * Gets the default type url for MasterAuthorizedNetworksConfig + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MasterAuthorizedNetworksConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig"; + }; - WorkloadsConfig.WorkerResource = (function() { + MasterAuthorizedNetworksConfig.CidrBlock = (function() { /** - * Properties of a WorkerResource. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @interface IWorkerResource - * @property {number|null} [cpu] WorkerResource cpu - * @property {number|null} [memoryGb] WorkerResource memoryGb - * @property {number|null} [storageGb] WorkerResource storageGb - * @property {number|null} [minCount] WorkerResource minCount - * @property {number|null} [maxCount] WorkerResource maxCount + * Properties of a CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @interface ICidrBlock + * @property {string|null} [displayName] CidrBlock displayName + * @property {string|null} [cidrBlock] CidrBlock cidrBlock */ /** - * Constructs a new WorkerResource. - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig - * @classdesc Represents a WorkerResource. - * @implements IWorkerResource + * Constructs a new CidrBlock. + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig + * @classdesc Represents a CidrBlock. + * @implements ICidrBlock * @constructor - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set */ - function WorkerResource(properties) { + function CidrBlock(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13479,131 +21115,89 @@ } /** - * WorkerResource cpu. - * @member {number} cpu - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.cpu = 0; - - /** - * WorkerResource memoryGb. - * @member {number} memoryGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.memoryGb = 0; - - /** - * WorkerResource storageGb. - * @member {number} storageGb - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource - * @instance - */ - WorkerResource.prototype.storageGb = 0; - - /** - * WorkerResource minCount. - * @member {number} minCount - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * CidrBlock displayName. + * @member {string} displayName + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @instance */ - WorkerResource.prototype.minCount = 0; + CidrBlock.prototype.displayName = ""; /** - * WorkerResource maxCount. - * @member {number} maxCount - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * CidrBlock cidrBlock. + * @member {string} cidrBlock + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @instance */ - WorkerResource.prototype.maxCount = 0; + CidrBlock.prototype.cidrBlock = ""; /** - * Creates a new WorkerResource instance using the specified properties. + * Creates a new CidrBlock instance using the specified properties. * @function create - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource=} [properties] Properties to set - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource instance + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock instance */ - WorkerResource.create = function create(properties) { - return new WorkerResource(properties); + CidrBlock.create = function create(properties) { + return new CidrBlock(properties); }; /** - * Encodes the specified WorkerResource message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * Encodes the specified CidrBlock message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. * @function encode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WorkerResource.encode = function encode(message, writer) { + CidrBlock.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpu != null && Object.hasOwnProperty.call(message, "cpu")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.cpu); - if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.memoryGb); - if (message.storageGb != null && Object.hasOwnProperty.call(message, "storageGb")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.storageGb); - if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minCount); - if (message.maxCount != null && Object.hasOwnProperty.call(message, "maxCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxCount); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.cidrBlock != null && Object.hasOwnProperty.call(message, "cidrBlock")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cidrBlock); return writer; }; /** - * Encodes the specified WorkerResource message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource.verify|verify} messages. + * Encodes the specified CidrBlock message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.IWorkerResource} message WorkerResource message or plain object to encode + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.ICidrBlock} message CidrBlock message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WorkerResource.encodeDelimited = function encodeDelimited(message, writer) { + CidrBlock.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WorkerResource message from the specified reader or buffer. + * Decodes a CidrBlock message from the specified reader or buffer. * @function decode - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkerResource.decode = function decode(reader, length) { + CidrBlock.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.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cpu = reader.float(); + message.displayName = reader.string(); break; } case 2: { - message.memoryGb = reader.float(); - break; - } - case 3: { - message.storageGb = reader.float(); - break; - } - case 4: { - message.minCount = reader.int32(); - break; - } - case 5: { - message.maxCount = reader.int32(); + message.cidrBlock = reader.string(); break; } default: @@ -13615,138 +21209,317 @@ }; /** - * Decodes a WorkerResource message from the specified reader or buffer, length delimited. + * Decodes a CidrBlock message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkerResource.decodeDelimited = function decodeDelimited(reader) { + CidrBlock.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WorkerResource message. + * Verifies a CidrBlock message. * @function verify - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WorkerResource.verify = function verify(message) { + CidrBlock.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cpu != null && message.hasOwnProperty("cpu")) - if (typeof message.cpu !== "number") - return "cpu: number expected"; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - if (typeof message.memoryGb !== "number") - return "memoryGb: number expected"; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - if (typeof message.storageGb !== "number") - return "storageGb: number expected"; - if (message.minCount != null && message.hasOwnProperty("minCount")) - if (!$util.isInteger(message.minCount)) - return "minCount: integer expected"; - if (message.maxCount != null && message.hasOwnProperty("maxCount")) - if (!$util.isInteger(message.maxCount)) - return "maxCount: integer expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + if (!$util.isString(message.cidrBlock)) + return "cidrBlock: string expected"; return null; }; /** - * Creates a WorkerResource message from a plain object. Also converts values to their respective internal types. + * Creates a CidrBlock message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static * @param {Object.} object Plain object - * @returns {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} WorkerResource + * @returns {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock} CidrBlock */ - WorkerResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource) + CidrBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock) return object; - var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource(); - if (object.cpu != null) - message.cpu = Number(object.cpu); - if (object.memoryGb != null) - message.memoryGb = Number(object.memoryGb); - if (object.storageGb != null) - message.storageGb = Number(object.storageGb); - if (object.minCount != null) - message.minCount = object.minCount | 0; - if (object.maxCount != null) - message.maxCount = object.maxCount | 0; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.cidrBlock != null) + message.cidrBlock = String(object.cidrBlock); return message; }; /** - * Creates a plain object from a WorkerResource message. Also converts values to other types if specified. + * Creates a plain object from a CidrBlock message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static - * @param {google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource} message WorkerResource + * @param {google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock} message CidrBlock * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WorkerResource.toObject = function toObject(message, options) { + CidrBlock.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.cpu = 0; - object.memoryGb = 0; - object.storageGb = 0; - object.minCount = 0; - object.maxCount = 0; + object.displayName = ""; + object.cidrBlock = ""; } - if (message.cpu != null && message.hasOwnProperty("cpu")) - object.cpu = options.json && !isFinite(message.cpu) ? String(message.cpu) : message.cpu; - if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) - object.memoryGb = options.json && !isFinite(message.memoryGb) ? String(message.memoryGb) : message.memoryGb; - if (message.storageGb != null && message.hasOwnProperty("storageGb")) - object.storageGb = options.json && !isFinite(message.storageGb) ? String(message.storageGb) : message.storageGb; - if (message.minCount != null && message.hasOwnProperty("minCount")) - object.minCount = message.minCount; - if (message.maxCount != null && message.hasOwnProperty("maxCount")) - object.maxCount = message.maxCount; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.cidrBlock != null && message.hasOwnProperty("cidrBlock")) + object.cidrBlock = message.cidrBlock; return object; }; /** - * Converts this WorkerResource to JSON. + * Converts this CidrBlock to JSON. * @function toJSON - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @instance * @returns {Object.} JSON object */ - WorkerResource.prototype.toJSON = function toJSON() { + CidrBlock.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WorkerResource + * Gets the default type url for CidrBlock * @function getTypeUrl - * @memberof google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource + * @memberof google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WorkerResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CidrBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.WorkloadsConfig.WorkerResource"; + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock"; }; - return WorkerResource; + return CidrBlock; })(); - return WorkloadsConfig; + return MasterAuthorizedNetworksConfig; + })(); + + v1beta1.CloudDataLineageIntegration = (function() { + + /** + * Properties of a CloudDataLineageIntegration. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @interface ICloudDataLineageIntegration + * @property {boolean|null} [enabled] CloudDataLineageIntegration enabled + */ + + /** + * Constructs a new CloudDataLineageIntegration. + * @memberof google.cloud.orchestration.airflow.service.v1beta1 + * @classdesc Represents a CloudDataLineageIntegration. + * @implements ICloudDataLineageIntegration + * @constructor + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration=} [properties] Properties to set + */ + function CloudDataLineageIntegration(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]]; + } + + /** + * CloudDataLineageIntegration enabled. + * @member {boolean} enabled + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @instance + */ + CloudDataLineageIntegration.prototype.enabled = false; + + /** + * Creates a new CloudDataLineageIntegration instance using the specified properties. + * @function create + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration=} [properties] Properties to set + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration} CloudDataLineageIntegration instance + */ + CloudDataLineageIntegration.create = function create(properties) { + return new CloudDataLineageIntegration(properties); + }; + + /** + * Encodes the specified CloudDataLineageIntegration message. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.verify|verify} messages. + * @function encode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration} message CloudDataLineageIntegration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDataLineageIntegration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + return writer; + }; + + /** + * Encodes the specified CloudDataLineageIntegration message, length delimited. Does not implicitly {@link google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.ICloudDataLineageIntegration} message CloudDataLineageIntegration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudDataLineageIntegration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudDataLineageIntegration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration} CloudDataLineageIntegration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDataLineageIntegration.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.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudDataLineageIntegration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration} CloudDataLineageIntegration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudDataLineageIntegration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudDataLineageIntegration message. + * @function verify + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudDataLineageIntegration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + return null; + }; + + /** + * Creates a CloudDataLineageIntegration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration} CloudDataLineageIntegration + */ + CloudDataLineageIntegration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration) + return object; + var message = new $root.google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + return message; + }; + + /** + * Creates a plain object from a CloudDataLineageIntegration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration} message CloudDataLineageIntegration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudDataLineageIntegration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enabled = false; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + return object; + }; + + /** + * Converts this CloudDataLineageIntegration to JSON. + * @function toJSON + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @instance + * @returns {Object.} JSON object + */ + CloudDataLineageIntegration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudDataLineageIntegration + * @function getTypeUrl + * @memberof google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudDataLineageIntegration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orchestration.airflow.service.v1beta1.CloudDataLineageIntegration"; + }; + + return CloudDataLineageIntegration; })(); v1beta1.Environment = (function() { @@ -15958,6 +23731,8 @@ case 2: case 3: case 4: + case 5: + case 6: break; } if (message.resource != null && message.hasOwnProperty("resource")) @@ -16046,6 +23821,14 @@ case 4: message.operationType = 4; break; + case "SAVE_SNAPSHOT": + case 5: + message.operationType = 5; + break; + case "LOAD_SNAPSHOT": + case 6: + message.operationType = 6; + break; } if (object.resource != null) message.resource = String(object.resource); @@ -16155,6 +23938,8 @@ * @property {number} DELETE=2 DELETE value * @property {number} UPDATE=3 UPDATE value * @property {number} CHECK=4 CHECK value + * @property {number} SAVE_SNAPSHOT=5 SAVE_SNAPSHOT value + * @property {number} LOAD_SNAPSHOT=6 LOAD_SNAPSHOT value */ OperationMetadata.Type = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -16163,6 +23948,8 @@ values[valuesById[2] = "DELETE"] = 2; values[valuesById[3] = "UPDATE"] = 3; values[valuesById[4] = "CHECK"] = 4; + values[valuesById[5] = "SAVE_SNAPSHOT"] = 5; + values[valuesById[6] = "LOAD_SNAPSHOT"] = 6; return values; })(); diff --git a/packages/google-cloud-orchestration-airflow-service/protos/protos.json b/packages/google-cloud-orchestration-airflow-service/protos/protos.json index ec581aea00f..4649413cac0 100644 --- a/packages/google-cloud-orchestration-airflow-service/protos/protos.json +++ b/packages/google-cloud-orchestration-airflow-service/protos/protos.json @@ -141,6 +141,54 @@ } } ] + }, + "SaveSnapshot": { + "requestType": "SaveSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:saveSnapshot", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse", + "metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + } + } + ] + }, + "LoadSnapshot": { + "requestType": "LoadSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{environment=projects/*/locations/*/environments/*}:loadSnapshot", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse", + "metadata_type": "google.cloud.orchestration.airflow.service.v1.OperationMetadata" + } + } + ] } } }, @@ -217,6 +265,57 @@ } } }, + "SaveSnapshotRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "snapshotLocation": { + "type": "string", + "id": 2 + } + } + }, + "SaveSnapshotResponse": { + "fields": { + "snapshotPath": { + "type": "string", + "id": 1 + } + } + }, + "LoadSnapshotRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "snapshotPath": { + "type": "string", + "id": 2 + }, + "skipPypiPackagesInstallation": { + "type": "bool", + "id": 3 + }, + "skipEnvironmentVariablesSetting": { + "type": "bool", + "id": 4 + }, + "skipAirflowOverridesSetting": { + "type": "bool", + "id": 5 + }, + "skipGcsDataCopying": { + "type": "bool", + "id": 6 + } + } + }, + "LoadSnapshotResponse": { + "fields": {} + }, "EnvironmentConfig": { "fields": { "gkeCluster": { @@ -271,9 +370,54 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "maintenanceWindow": { + "type": "MaintenanceWindow", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workloadsConfig": { + "type": "WorkloadsConfig", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentSize": { + "type": "EnvironmentSize", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "airflowUri": { "type": "string", "id": 6 + }, + "masterAuthorizedNetworksConfig": { + "type": "MasterAuthorizedNetworksConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "recoveryConfig": { + "type": "RecoveryConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EnvironmentSize": { + "values": { + "ENVIRONMENT_SIZE_UNSPECIFIED": 0, + "ENVIRONMENT_SIZE_SMALL": 1, + "ENVIRONMENT_SIZE_MEDIUM": 2, + "ENVIRONMENT_SIZE_LARGE": 3 + } } } }, @@ -336,6 +480,31 @@ } } }, + "MaintenanceWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "recurrence": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "SoftwareConfig": { "fields": { "imageVersion": { @@ -360,6 +529,13 @@ "pythonVersion": { "type": "string", "id": 6 + }, + "schedulerCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -458,6 +634,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "enableIpMasqAgent": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -486,6 +669,26 @@ } } }, + "NetworkingConfig": { + "fields": { + "connectionType": { + "type": "ConnectionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConnectionType": { + "values": { + "CONNECTION_TYPE_UNSPECIFIED": 0, + "VPC_PEERING": 1, + "PRIVATE_SERVICE_CONNECT": 2 + } + } + } + }, "PrivateEnvironmentConfig": { "fields": { "enablePrivateEnvironment": { @@ -522,6 +725,234 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "cloudComposerNetworkIpv4CidrBlock": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudComposerNetworkIpv4ReservedRange": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enablePrivatelyUsedPublicIps": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudComposerConnectionSubnetwork": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkingConfig": { + "type": "NetworkingConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WorkloadsConfig": { + "fields": { + "scheduler": { + "type": "SchedulerResource", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "webServer": { + "type": "WebServerResource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "worker": { + "type": "WorkerResource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "SchedulerResource": { + "fields": { + "cpu": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "memoryGb": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageGb": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "count": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WebServerResource": { + "fields": { + "cpu": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "memoryGb": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageGb": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WorkerResource": { + "fields": { + "cpu": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "memoryGb": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "storageGb": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "RecoveryConfig": { + "fields": { + "scheduledSnapshotsConfig": { + "type": "ScheduledSnapshotsConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScheduledSnapshotsConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshotLocation": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshotCreationSchedule": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MasterAuthorizedNetworksConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "cidrBlocks": { + "rule": "repeated", + "type": "CidrBlock", + "id": 2 + } + }, + "nested": { + "CidrBlock": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "cidrBlock": { + "type": "string", + "id": 2 + } + } } } }, @@ -752,7 +1183,9 @@ "CREATE": 1, "DELETE": 2, "UPDATE": 3, - "CHECK": 4 + "CHECK": 4, + "SAVE_SNAPSHOT": 5, + "LOAD_SNAPSHOT": 6 } } } @@ -869,71 +1302,119 @@ "requestType": "DeleteEnvironmentRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/environments/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/environments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/environments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + } + } + ] + }, + "RestartWebServer": { + "requestType": "RestartWebServerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Environment", + "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" + } + } + ] + }, + "CheckUpgrade": { + "requestType": "CheckUpgradeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1beta1/{name=projects/*/locations/*/environments/*}" + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade", + "body": "*" } }, - { - "(google.api.method_signature)": "name" - }, { "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", + "response_type": "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse", "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" } } ] }, - "RestartWebServer": { - "requestType": "RestartWebServerRequest", + "SaveSnapshot": { + "requestType": "SaveSnapshotRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer", + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:saveSnapshot", "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Environment", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta1/{name=projects/*/locations/*/environments/*}:restartWebServer", + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:saveSnapshot", "body": "*" } }, { "(google.longrunning.operation_info)": { - "response_type": "Environment", + "response_type": "google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse", "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" } } ] }, - "CheckUpgrade": { - "requestType": "CheckUpgradeRequest", + "LoadSnapshot": { + "requestType": "LoadSnapshotRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade", + "(google.api.http).post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:loadSnapshot", "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse", + "(google.longrunning.operation_info).response_type": "google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse", "(google.longrunning.operation_info).metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:checkUpgrade", + "post": "/v1beta1/{environment=projects/*/locations/*/environments/*}:loadSnapshot", "body": "*" } }, { "(google.longrunning.operation_info)": { - "response_type": "google.cloud.orchestration.airflow.service.v1beta1.CheckUpgradeResponse", + "response_type": "google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse", "metadata_type": "google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata" } } @@ -1025,6 +1506,120 @@ } } }, + "ExecuteAirflowCommandResponse": { + "fields": { + "executionId": { + "type": "string", + "id": 1 + }, + "pod": { + "type": "string", + "id": 2 + }, + "podNamespace": { + "type": "string", + "id": 3 + }, + "error": { + "type": "string", + "id": 4 + } + } + }, + "PollAirflowCommandResponse": { + "fields": { + "output": { + "rule": "repeated", + "type": "Line", + "id": 1 + }, + "outputEnd": { + "type": "bool", + "id": 2 + }, + "exitInfo": { + "type": "ExitInfo", + "id": 3 + } + }, + "nested": { + "Line": { + "fields": { + "lineNumber": { + "type": "int32", + "id": 1 + }, + "content": { + "type": "string", + "id": 2 + } + } + }, + "ExitInfo": { + "fields": { + "exitCode": { + "type": "int32", + "id": 1 + }, + "error": { + "type": "string", + "id": 2 + } + } + } + } + }, + "SaveSnapshotRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "snapshotLocation": { + "type": "string", + "id": 2 + } + } + }, + "SaveSnapshotResponse": { + "fields": { + "snapshotPath": { + "type": "string", + "id": 1 + } + } + }, + "LoadSnapshotRequest": { + "fields": { + "environment": { + "type": "string", + "id": 1 + }, + "snapshotPath": { + "type": "string", + "id": 2 + }, + "skipPypiPackagesInstallation": { + "type": "bool", + "id": 3 + }, + "skipEnvironmentVariablesSetting": { + "type": "bool", + "id": 4 + }, + "skipAirflowOverridesSetting": { + "type": "bool", + "id": 5 + }, + "skipGcsDataCopying": { + "type": "bool", + "id": 6 + } + } + }, + "LoadSnapshotResponse": { + "fields": {} + }, "EnvironmentConfig": { "fields": { "gkeCluster": { @@ -1112,6 +1707,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "masterAuthorizedNetworksConfig": { + "type": "MasterAuthorizedNetworksConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "recoveryConfig": { + "type": "RecoveryConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1187,6 +1796,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "schedulerCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudDataLineageIntegration": { + "type": "CloudDataLineageIntegration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1302,6 +1925,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "enableIpMasqAgent": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1330,6 +1960,26 @@ } } }, + "NetworkingConfig": { + "fields": { + "connectionType": { + "type": "ConnectionType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConnectionType": { + "values": { + "CONNECTION_TYPE_UNSPECIFIED": 0, + "VPC_PEERING": 1, + "PRIVATE_SERVICE_CONNECT": 2 + } + } + } + }, "PrivateEnvironmentConfig": { "fields": { "enablePrivateEnvironment": { @@ -1380,6 +2030,27 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "enablePrivatelyUsedPublicIps": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudComposerConnectionSubnetwork": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkingConfig": { + "type": "NetworkingConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1463,6 +2134,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "triggerer": { + "type": "TriggererResource", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1561,6 +2239,112 @@ } } } + }, + "TriggererResource": { + "fields": { + "count": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cpu": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "memoryGb": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "RecoveryConfig": { + "fields": { + "scheduledSnapshotsConfig": { + "type": "ScheduledSnapshotsConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ScheduledSnapshotsConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshotLocation": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshotCreationSchedule": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeZone": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MasterAuthorizedNetworksConfig": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "cidrBlocks": { + "rule": "repeated", + "type": "CidrBlock", + "id": 2 + } + }, + "nested": { + "CidrBlock": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "cidrBlock": { + "type": "string", + "id": 2 + } + } + } + } + }, + "CloudDataLineageIntegration": { + "fields": { + "enabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -1811,7 +2595,9 @@ "CREATE": 1, "DELETE": 2, "UPDATE": 3, - "CHECK": 4 + "CHECK": 4, + "SAVE_SNAPSHOT": 5, + "LOAD_SNAPSHOT": 6 } } } diff --git a/packages/google-cloud-orchestration-airflow-service/samples/README.md b/packages/google-cloud-orchestration-airflow-service/samples/README.md index 0051b2ea5e7..2e506e5dd4e 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/README.md +++ b/packages/google-cloud-orchestration-airflow-service/samples/README.md @@ -16,6 +16,8 @@ * [Environments.delete_environment](#environments.delete_environment) * [Environments.get_environment](#environments.get_environment) * [Environments.list_environments](#environments.list_environments) + * [Environments.load_snapshot](#environments.load_snapshot) + * [Environments.save_snapshot](#environments.save_snapshot) * [Environments.update_environment](#environments.update_environment) * [Image_versions.list_image_versions](#image_versions.list_image_versions) * [Environments.check_upgrade](#environments.check_upgrade) @@ -23,7 +25,9 @@ * [Environments.delete_environment](#environments.delete_environment) * [Environments.get_environment](#environments.get_environment) * [Environments.list_environments](#environments.list_environments) + * [Environments.load_snapshot](#environments.load_snapshot) * [Environments.restart_web_server](#environments.restart_web_server) + * [Environments.save_snapshot](#environments.save_snapshot) * [Environments.update_environment](#environments.update_environment) * [Image_versions.list_image_versions](#image_versions.list_image_versions) * [Quickstart](#quickstart) @@ -112,6 +116,40 @@ __Usage:__ +### Environments.load_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.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-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js` + + +----- + + + + +### Environments.save_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.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-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js` + + +----- + + + + ### Environments.update_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js). @@ -231,6 +269,23 @@ __Usage:__ +### Environments.load_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.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-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js` + + +----- + + + + ### Environments.restart_web_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.restart_web_server.js). @@ -248,6 +303,23 @@ __Usage:__ +### Environments.save_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.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-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js` + + +----- + + + + ### Environments.update_environment View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js). diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js similarity index 100% rename from owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.load_snapshot.js rename to packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.load_snapshot.js diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js similarity index 100% rename from owl-bot-staging/google-cloud-orchestration-airflow-service/v1/samples/generated/v1/environments.save_snapshot.js rename to packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.save_snapshot.js diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js index 3de9c9b3aaa..aaf10d52979 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/environments.update_environment.js @@ -116,13 +116,10 @@ function main() { * * `config.nodeCount` * * Horizontally scale the number of nodes in the environment. An integer * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. * * `config.webServerNetworkAccessControl` * * Replace the environment's current `WebServerNetworkAccessControl`. - * * `config.databaseConfig` - * * Replace the environment's current `DatabaseConfig`. - * * `config.webServerConfig` - * * Replace the environment's current `WebServerConfig`. * * `config.softwareConfig.airflowConfigOverrides` * * Replace all Apache Airflow config overrides. If a replacement config * overrides map is not included in `environment`, all config overrides @@ -140,9 +137,22 @@ function main() { * * `config.softwareConfig.envVariables` * * Replace all environment variables. If a replacement environment * variable map is not included in `environment`, all custom environment - * variables are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual environment variables. + * variables are cleared. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. */ // const updateMask = {} diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json index c4a4d33339d..f6afa3e17a2 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1/snippet_metadata.google.cloud.orchestration.airflow.service.v1.json @@ -154,7 +154,7 @@ "segments": [ { "start": 25, - "end": 166, + "end": 176, "type": "FULL" } ], @@ -231,6 +231,110 @@ } } }, + { + "regionTag": "composer_v1_generated_Environments_SaveSnapshot_async", + "title": "Environments saveSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", + "canonical": true, + "file": "environments.save_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.SaveSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1_generated_Environments_LoadSnapshot_async", + "title": "Environments loadSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", + "canonical": true, + "file": "environments.load_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_path", + "type": "TYPE_STRING" + }, + { + "name": "skip_pypi_packages_installation", + "type": "TYPE_BOOL" + }, + { + "name": "skip_environment_variables_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_airflow_overrides_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_gcs_data_copying", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1.EnvironmentsClient" + }, + "method": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments.LoadSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1.Environments" + } + } + } + }, { "regionTag": "composer_v1_generated_ImageVersions_ListImageVersions_async", "title": "Environments listImageVersions Sample", diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js index b0aa2ef8ea5..53775ee99d7 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.check_upgrade.js @@ -38,20 +38,23 @@ function main() { * The version of the software running in the environment. * This encapsulates both the version of Cloud Composer functionality and the * version of Apache Airflow. It must match the regular expression - * `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[0-9]+(\.[0-9]+.*)?`. + * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. * When used as input, the server also checks if the provided version is * supported and denies the request for an unsupported version. - * The Cloud Composer portion of the version is a - * semantic version (https://semver.org) or `latest`. When the patch version - * is omitted, the current Cloud Composer patch version is selected. - * When `latest` is provided instead of an explicit version number, - * the server replaces `latest` with the current Cloud Composer version - * and stores that version number in the same field. - * The portion of the image version that follows `airflow-` is an - * official Apache Airflow repository - * release name (https://github.com/apache/incubator-airflow/releases). - * See also Version List - * (/composer/docs/concepts/versioning/composer-versions). + * The Cloud Composer portion of the image version is a full + * semantic version (https://semver.org), or an alias in the form of major + * version number or `latest`. When an alias is provided, the server replaces + * it with the current Cloud Composer version that satisfies the alias. + * The Apache Airflow portion of the image version is a full semantic version + * that points to one of the supported Apache Airflow versions, or an alias in + * the form of only major or major.minor versions specified. When an alias is + * provided, the server replaces it with the latest Apache Airflow version + * that satisfies the alias and is supported in the given Cloud Composer + * version. + * In all cases, the resolved image version is stored in the same field. + * See also version + * list (/composer/docs/concepts/versioning/composer-versions) and versioning + * overview (/composer/docs/concepts/versioning/composer-versioning-overview). */ // const imageVersion = 'abc123' diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js similarity index 100% rename from owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.load_snapshot.js rename to packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.load_snapshot.js diff --git a/owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js similarity index 100% rename from owl-bot-staging/google-cloud-orchestration-airflow-service/v1beta1/samples/generated/v1beta1/environments.save_snapshot.js rename to packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.save_snapshot.js diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js index 01ae22759d4..9ce9ee97029 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/environments.update_environment.js @@ -116,7 +116,9 @@ function main(updateMask) { * * `config.nodeCount` * * Horizontally scale the number of nodes in the environment. An integer * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. * `config.webServerNetworkAccessControl` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` * * Replace the environment's current WebServerNetworkAccessControl. * * `config.softwareConfig.airflowConfigOverrides` * * Replace all Apache Airflow config overrides. If a replacement config @@ -135,30 +137,43 @@ function main(updateMask) { * * `config.softwareConfig.envVariables` * * Replace all environment variables. If a replacement environment * variable map is not included in `environment`, all custom environment - * variables are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual environment variables. + * variables are cleared. * * `config.softwareConfig.imageVersion` * * Upgrade the version of the environment in-place. Refer to * `SoftwareConfig.image_version` for information on how to format the * new image version. Additionally, the new image version cannot effect - * a version downgrade and must match the current image version's - * Composer major version and Airflow major and minor versions. Consult - * the Cloud Composer Version - * List (https://cloud.google.com/composer/docs/concepts/versioning/composer-versions) + * a version downgrade, and must match the current image version's + * Composer and Airflow major versions. Consult the Cloud Composer + * version list (/composer/docs/concepts/versioning/composer-versions) * for valid values. * * `config.softwareConfig.schedulerCount` * * Horizontally scale the number of schedulers in Airflow. A positive * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. * `config.databaseConfig.machineType` + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.softwareConfig.cloudDataLineageIntegration` + * * Configuration for Cloud Data Lineage integration. + * * `config.databaseConfig.machineType` * * Cloud SQL machine type used by Airflow database. * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. * `config.webServerConfig.machineType` + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` * * Machine type on which Airflow web server is running. * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. * `config.maintenanceWindow` + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + * * `config.maintenanceWindow` * * Maintenance window during which Cloud Composer components may be * under maintenance. + * * `config.workloadsConfig` + * * The workloads configuration settings for the GKE cluster associated + * with the Cloud Composer environment. Supported for Cloud Composer + * environments in versions composer-2.*.*-airflow-*.*.* and newer. + * * `config.environmentSize` + * * The size of the Cloud Composer environment. Supported for Cloud + * Composer environments in versions composer-2.*.*-airflow-*.*.* and + * newer. */ // const updateMask = {} diff --git a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json index f25bbddaf9e..4ab57bfc932 100644 --- a/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json +++ b/packages/google-cloud-orchestration-airflow-service/samples/generated/v1beta1/snippet_metadata.google.cloud.orchestration.airflow.service.v1beta1.json @@ -154,7 +154,7 @@ "segments": [ { "start": 25, - "end": 183, + "end": 198, "type": "FULL" } ], @@ -282,7 +282,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -315,6 +315,110 @@ } } }, + { + "regionTag": "composer_v1beta1_generated_Environments_SaveSnapshot_async", + "title": "Environments saveSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a snapshots of a Cloud Composer environment. As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.", + "canonical": true, + "file": "environments.save_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_location", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "SaveSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.SaveSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, + { + "regionTag": "composer_v1beta1_generated_Environments_LoadSnapshot_async", + "title": "Environments loadSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Loads a snapshot of a Cloud Composer environment. As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.", + "canonical": true, + "file": "environments.load_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", + "async": true, + "parameters": [ + { + "name": "environment", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_path", + "type": "TYPE_STRING" + }, + { + "name": "skip_pypi_packages_installation", + "type": "TYPE_BOOL" + }, + { + "name": "skip_environment_variables_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_airflow_overrides_setting", + "type": "TYPE_BOOL" + }, + { + "name": "skip_gcs_data_copying", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EnvironmentsClient", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.EnvironmentsClient" + }, + "method": { + "shortName": "LoadSnapshot", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments.LoadSnapshot", + "service": { + "shortName": "Environments", + "fullName": "google.cloud.orchestration.airflow.service.v1beta1.Environments" + } + } + } + }, { "regionTag": "composer_v1beta1_generated_ImageVersions_ListImageVersions_async", "title": "Environments listImageVersions Sample", diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts index a313b7750f2..299fc81f3b3 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client.ts @@ -240,6 +240,18 @@ export class EnvironmentsClient { const deleteEnvironmentMetadata = protoFilesRoot.lookup( '.google.cloud.orchestration.airflow.service.v1.OperationMetadata' ) as gax.protobuf.Type; + const saveSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse' + ) as gax.protobuf.Type; + const saveSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata' + ) as gax.protobuf.Type; + const loadSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse' + ) as gax.protobuf.Type; + const loadSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEnvironment: new this._gaxModule.LongrunningDescriptor( @@ -257,6 +269,16 @@ export class EnvironmentsClient { deleteEnvironmentResponse.decode.bind(deleteEnvironmentResponse), deleteEnvironmentMetadata.decode.bind(deleteEnvironmentMetadata) ), + saveSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + saveSnapshotResponse.decode.bind(saveSnapshotResponse), + saveSnapshotMetadata.decode.bind(saveSnapshotMetadata) + ), + loadSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadSnapshotResponse.decode.bind(loadSnapshotResponse), + loadSnapshotMetadata.decode.bind(loadSnapshotMetadata) + ), }; // Put together the default options sent with requests. @@ -315,6 +337,8 @@ export class EnvironmentsClient { 'listEnvironments', 'updateEnvironment', 'deleteEnvironment', + 'saveSnapshot', + 'loadSnapshot', ]; for (const methodName of environmentsStubMethods) { const callPromise = this.environmentsStub.then( @@ -739,13 +763,10 @@ export class EnvironmentsClient { * * `config.nodeCount` * * Horizontally scale the number of nodes in the environment. An integer * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. * * `config.webServerNetworkAccessControl` * * Replace the environment's current `WebServerNetworkAccessControl`. - * * `config.databaseConfig` - * * Replace the environment's current `DatabaseConfig`. - * * `config.webServerConfig` - * * Replace the environment's current `WebServerConfig`. * * `config.softwareConfig.airflowConfigOverrides` * * Replace all Apache Airflow config overrides. If a replacement config * overrides map is not included in `environment`, all config overrides @@ -763,9 +784,22 @@ export class EnvironmentsClient { * * `config.softwareConfig.envVariables` * * Replace all environment variables. If a replacement environment * variable map is not included in `environment`, all custom environment - * variables are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual environment variables. + * variables are cleared. + * * `config.softwareConfig.schedulerCount` + * * Horizontally scale the number of schedulers in Airflow. A positive + * integer not greater than the number of nodes must be provided in the + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.databaseConfig.machineType` + * * Cloud SQL machine type used by Airflow database. + * It has to be one of: db-n1-standard-2, db-n1-standard-4, + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` + * * Machine type on which Airflow web server is running. + * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. * @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. @@ -1036,6 +1070,308 @@ export class EnvironmentsClient { protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata >; } + /** + * Creates a snapshots of a Cloud Composer environment. + * + * As a result of this operation, snapshot of environment's state is stored + * in a location specified in the SaveSnapshotRequest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotLocation + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + * @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/v1/environments.save_snapshot.js + * region_tag:composer_v1_generated_Environments_SaveSnapshot_async + */ + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + 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'] = + this._gaxModule.routingHeader.fromParams({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.saveSnapshot(request, options, callback); + } + /** + * Check the status of the long running operation returned by `saveSnapshot()`. + * @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 include:samples/generated/v1/environments.save_snapshot.js + * region_tag:composer_v1_generated_Environments_SaveSnapshot_async + */ + async checkSaveSnapshotProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.saveSnapshot, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata + >; + } + /** + * Loads a snapshot of a Cloud Composer environment. + * + * As a result of this operation, a snapshot of environment's specified in + * LoadSnapshotRequest is loaded into the environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotPath + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + * @param {boolean} request.skipPypiPackagesInstallation + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + * @param {boolean} request.skipEnvironmentVariablesSetting + * Whether or not to skip setting environment variables when loading the + * environment's state. + * @param {boolean} request.skipAirflowOverridesSetting + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + * @param {boolean} request.skipGcsDataCopying + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + * @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/v1/environments.load_snapshot.js + * region_tag:composer_v1_generated_Environments_LoadSnapshot_async + */ + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >, + 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'] = + this._gaxModule.routingHeader.fromParams({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.loadSnapshot(request, options, callback); + } + /** + * Check the status of the long running operation returned by `loadSnapshot()`. + * @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 include:samples/generated/v1/environments.load_snapshot.js + * region_tag:composer_v1_generated_Environments_LoadSnapshot_async + */ + async checkLoadSnapshotProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.loadSnapshot, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.OperationMetadata + >; + } /** * List environments. * @@ -1228,6 +1564,183 @@ export class EnvironmentsClient { callSettings ) as AsyncIterable; } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {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 {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json index 337dfdcfb16..2f3d92af1f0 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/environments_client_config.json @@ -39,6 +39,14 @@ "DeleteEnvironment": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "SaveSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LoadSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json b/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json index 089e0ceae96..0bb4722298e 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1/gapic_metadata.json @@ -30,6 +30,16 @@ "deleteEnvironment" ] }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -62,6 +72,16 @@ "deleteEnvironment" ] }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts index cd7145f9bb8..67c2c77e613 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client.ts @@ -252,6 +252,18 @@ export class EnvironmentsClient { const checkUpgradeMetadata = protoFilesRoot.lookup( '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata' ) as gax.protobuf.Type; + const saveSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse' + ) as gax.protobuf.Type; + const saveSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; + const loadSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse' + ) as gax.protobuf.Type; + const loadSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createEnvironment: new this._gaxModule.LongrunningDescriptor( @@ -279,6 +291,16 @@ export class EnvironmentsClient { checkUpgradeResponse.decode.bind(checkUpgradeResponse), checkUpgradeMetadata.decode.bind(checkUpgradeMetadata) ), + saveSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + saveSnapshotResponse.decode.bind(saveSnapshotResponse), + saveSnapshotMetadata.decode.bind(saveSnapshotMetadata) + ), + loadSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + loadSnapshotResponse.decode.bind(loadSnapshotResponse), + loadSnapshotMetadata.decode.bind(loadSnapshotMetadata) + ), }; // Put together the default options sent with requests. @@ -339,6 +361,8 @@ export class EnvironmentsClient { 'deleteEnvironment', 'restartWebServer', 'checkUpgrade', + 'saveSnapshot', + 'loadSnapshot', ]; for (const methodName of environmentsStubMethods) { const callPromise = this.environmentsStub.then( @@ -763,7 +787,9 @@ export class EnvironmentsClient { * * `config.nodeCount` * * Horizontally scale the number of nodes in the environment. An integer * greater than or equal to 3 must be provided in the `config.nodeCount` - * field. * `config.webServerNetworkAccessControl` + * field. Supported for Cloud Composer environments in versions + * composer-1.*.*-airflow-*.*.*. + * * `config.webServerNetworkAccessControl` * * Replace the environment's current WebServerNetworkAccessControl. * * `config.softwareConfig.airflowConfigOverrides` * * Replace all Apache Airflow config overrides. If a replacement config @@ -782,30 +808,43 @@ export class EnvironmentsClient { * * `config.softwareConfig.envVariables` * * Replace all environment variables. If a replacement environment * variable map is not included in `environment`, all custom environment - * variables are cleared. - * It is an error to provide both this mask and a mask specifying one or - * more individual environment variables. + * variables are cleared. * * `config.softwareConfig.imageVersion` * * Upgrade the version of the environment in-place. Refer to * `SoftwareConfig.image_version` for information on how to format the * new image version. Additionally, the new image version cannot effect - * a version downgrade and must match the current image version's - * Composer major version and Airflow major and minor versions. Consult - * the [Cloud Composer Version - * List](https://cloud.google.com/composer/docs/concepts/versioning/composer-versions) + * a version downgrade, and must match the current image version's + * Composer and Airflow major versions. Consult the [Cloud Composer + * version list](/composer/docs/concepts/versioning/composer-versions) * for valid values. * * `config.softwareConfig.schedulerCount` * * Horizontally scale the number of schedulers in Airflow. A positive * integer not greater than the number of nodes must be provided in the - * `config.softwareConfig.schedulerCount` field. * `config.databaseConfig.machineType` + * `config.softwareConfig.schedulerCount` field. Supported for Cloud + * Composer environments in versions composer-1.*.*-airflow-2.*.*. + * * `config.softwareConfig.cloudDataLineageIntegration` + * * Configuration for Cloud Data Lineage integration. + * * `config.databaseConfig.machineType` * * Cloud SQL machine type used by Airflow database. * It has to be one of: db-n1-standard-2, db-n1-standard-4, - * db-n1-standard-8 or db-n1-standard-16. * `config.webServerConfig.machineType` + * db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer + * environments in versions composer-1.*.*-airflow-*.*.*. + * * `config.webServerConfig.machineType` * * Machine type on which Airflow web server is running. * It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 - * or composer-n1-webserver-8. * `config.maintenanceWindow` + * or composer-n1-webserver-8. Supported for Cloud Composer environments + * in versions composer-1.*.*-airflow-*.*.*. + * * `config.maintenanceWindow` * * Maintenance window during which Cloud Composer components may be * under maintenance. + * * `config.workloadsConfig` + * * The workloads configuration settings for the GKE cluster associated + * with the Cloud Composer environment. Supported for Cloud Composer + * environments in versions composer-2.*.*-airflow-*.*.* and newer. + * * `config.environmentSize` + * * The size of the Cloud Composer environment. Supported for Cloud + * Composer environments in versions composer-2.*.*-airflow-*.*.* and + * newer. * @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. @@ -1231,23 +1270,27 @@ export class EnvironmentsClient { * The version of the software running in the environment. * This encapsulates both the version of Cloud Composer functionality and the * version of Apache Airflow. It must match the regular expression - * `composer-([0-9]+\.[0-9]+\.[0-9]+|latest)-airflow-[0-9]+\.[0-9]+(\.[0-9]+.*)?`. + * `composer-([0-9]+(\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?)?|latest)-airflow-([0-9]+(\.[0-9]+(\.[0-9]+)?)?)`. * When used as input, the server also checks if the provided version is * supported and denies the request for an unsupported version. * - * The Cloud Composer portion of the version is a - * [semantic version](https://semver.org) or `latest`. When the patch version - * is omitted, the current Cloud Composer patch version is selected. - * When `latest` is provided instead of an explicit version number, - * the server replaces `latest` with the current Cloud Composer version - * and stores that version number in the same field. + * The Cloud Composer portion of the image version is a full + * [semantic version](https://semver.org), or an alias in the form of major + * version number or `latest`. When an alias is provided, the server replaces + * it with the current Cloud Composer version that satisfies the alias. + * + * The Apache Airflow portion of the image version is a full semantic version + * that points to one of the supported Apache Airflow versions, or an alias in + * the form of only major or major.minor versions specified. When an alias is + * provided, the server replaces it with the latest Apache Airflow version + * that satisfies the alias and is supported in the given Cloud Composer + * version. * - * The portion of the image version that follows `airflow-` is an - * official Apache Airflow repository - * [release name](https://github.com/apache/incubator-airflow/releases). + * In all cases, the resolved image version is stored in the same field. * - * See also [Version List] - * (/composer/docs/concepts/versioning/composer-versions). + * See also [version + * list](/composer/docs/concepts/versioning/composer-versions) and [versioning + * overview](/composer/docs/concepts/versioning/composer-versioning-overview). * @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. @@ -1379,6 +1422,308 @@ export class EnvironmentsClient { protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata >; } + /** + * Creates a snapshots of a Cloud Composer environment. + * + * As a result of this operation, snapshot of environment's state is stored + * in a location specified in the SaveSnapshotRequest. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the source environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotLocation + * Location in a Cloud Storage where the snapshot is going to be stored, e.g.: + * "gs://my-bucket/snapshots". + * @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/v1beta1/environments.save_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async + */ + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + saveSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + saveSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + 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'] = + this._gaxModule.routingHeader.fromParams({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.saveSnapshot(request, options, callback); + } + /** + * Check the status of the long running operation returned by `saveSnapshot()`. + * @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 include:samples/generated/v1beta1/environments.save_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_SaveSnapshot_async + */ + async checkSaveSnapshotProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.saveSnapshot, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata + >; + } + /** + * Loads a snapshot of a Cloud Composer environment. + * + * As a result of this operation, a snapshot of environment's specified in + * LoadSnapshotRequest is loaded into the environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.environment + * The resource name of the target environment in the form: + * "projects/{projectId}/locations/{locationId}/environments/{environmentId}" + * @param {string} request.snapshotPath + * A Cloud Storage path to a snapshot to load, e.g.: + * "gs://my-bucket/snapshots/project_location_environment_timestamp". + * @param {boolean} request.skipPypiPackagesInstallation + * Whether or not to skip installing Pypi packages when loading the + * environment's state. + * @param {boolean} request.skipEnvironmentVariablesSetting + * Whether or not to skip setting environment variables when loading the + * environment's state. + * @param {boolean} request.skipAirflowOverridesSetting + * Whether or not to skip setting Airflow overrides when loading the + * environment's state. + * @param {boolean} request.skipGcsDataCopying + * Whether or not to skip copying Cloud Storage data when loading the + * environment's state. + * @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/v1beta1/environments.load_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async + */ + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + loadSnapshot( + request: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + callback: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + loadSnapshot( + request?: protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >, + 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'] = + this._gaxModule.routingHeader.fromParams({ + environment: request.environment ?? '', + }); + this.initialize(); + return this.innerApiCalls.loadSnapshot(request, options, callback); + } + /** + * Check the status of the long running operation returned by `loadSnapshot()`. + * @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 include:samples/generated/v1beta1/environments.load_snapshot.js + * region_tag:composer_v1beta1_generated_Environments_LoadSnapshot_async + */ + async checkLoadSnapshotProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.loadSnapshot, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.OperationMetadata + >; + } /** * List environments. * @@ -1571,6 +1916,183 @@ export class EnvironmentsClient { callSettings ) as AsyncIterable; } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. 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.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @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 {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 {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @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)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json index 737917512b6..f31d666bb58 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/environments_client_config.json @@ -47,6 +47,14 @@ "CheckUpgrade": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "SaveSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "LoadSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json index f00b768a35a..7dfe380be56 100644 --- a/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-orchestration-airflow-service/src/v1beta1/gapic_metadata.json @@ -40,6 +40,16 @@ "checkUpgrade" ] }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", @@ -82,6 +92,16 @@ "checkUpgrade" ] }, + "SaveSnapshot": { + "methods": [ + "saveSnapshot" + ] + }, + "LoadSnapshot": { + "methods": [ + "loadSnapshot" + ] + }, "ListEnvironments": { "methods": [ "listEnvironments", diff --git a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts index ba1a0d529fc..cd3c61375f3 100644 --- a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts +++ b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1.ts @@ -969,6 +969,386 @@ describe('v1.EnvironmentsClient', () => { }); }); + describe('saveSnapshot', () => { + it('invokes saveSnapshot without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.saveSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.saveSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.saveSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.saveSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSaveSnapshotProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSaveSnapshotProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('loadSnapshot', () => { + it('invokes loadSnapshot without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with call error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.loadSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with LRO error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.loadSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadSnapshotProgress without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadSnapshotProgress with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEnvironments', () => { it('invokes listEnvironments without error', async () => { const client = new environmentsModule.v1.EnvironmentsClient({ @@ -1303,6 +1683,311 @@ describe('v1.EnvironmentsClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new environmentsModule.v1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('environment', () => { diff --git a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts index a21768ea425..93070896912 100644 --- a/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts +++ b/packages/google-cloud-orchestration-airflow-service/test/gapic_environments_v1beta1.ts @@ -1355,6 +1355,386 @@ describe('v1beta1.EnvironmentsClient', () => { }); }); + describe('saveSnapshot', () => { + it('invokes saveSnapshot without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.saveSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.saveSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.saveSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ISaveSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.saveSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes saveSnapshot with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.SaveSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.saveSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.saveSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.saveSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSaveSnapshotProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSaveSnapshotProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkSaveSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('loadSnapshot', () => { + it('invokes loadSnapshot without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = stubLongRunningCall(expectedResponse); + const [operation] = await client.loadSnapshot(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.loadSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.loadSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.orchestration.airflow.service.v1beta1.ILoadSnapshotResponse, + protos.google.cloud.orchestration.airflow.service.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with call error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.loadSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes loadSnapshot with LRO error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.orchestration.airflow.service.v1beta1.LoadSnapshotRequest', + ['environment'] + ); + request.environment = defaultValue1; + const expectedHeaderRequestParams = `environment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.loadSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.loadSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.loadSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkLoadSnapshotProgress without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkLoadSnapshotProgress with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + 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.checkLoadSnapshotProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listEnvironments', () => { it('invokes listEnvironments without error', async () => { const client = new environmentsModule.v1beta1.EnvironmentsClient({ @@ -1689,6 +2069,311 @@ describe('v1beta1.EnvironmentsClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new environmentsModule.v1beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('environment', () => {